diff src/main/java/de/mpiwg/itgroup/ismi/browse/EntityDetailsBean.java @ 189:8aff920ec7c0

fix problem with making entities public when there are loops in the relations.
author Robert Casties <casties@mpiwg-berlin.mpg.de>
date Thu, 08 Nov 2018 20:15:02 +0100
parents 3d8b31508128
children c7fec83ab69a
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/itgroup/ismi/browse/EntityDetailsBean.java	Tue Nov 06 20:05:49 2018 +0100
+++ b/src/main/java/de/mpiwg/itgroup/ismi/browse/EntityDetailsBean.java	Thu Nov 08 20:15:02 2018 +0100
@@ -260,13 +260,14 @@
 	 */
 	public String actionChangeRelatedEntitiesPrivacity() {
 		// set publication state
-		List<Entity> saveList = PrivacityUtils.setRelatedEntitiesPrivacity(this.entity, null, getWrapper(), null);
+		Map<Long, Entity> modified = new HashMap<Long,Entity>();
+		modified = PrivacityUtils.setRelatedEntitiesPrivacity(this.entity, null, getWrapper(), null, modified);
 		// hide related entities from display
 		sourceRelations = new HashMap<String, List<Relation>>();
 		targetRelations = new HashMap<String, List<Relation>>();
 		// save entities
 		try {
-			getWrapper().saveEntityListAsNodeWithoutContent(saveList, getUserName());
+			getWrapper().saveEntityListAsNodeWithoutContent(new ArrayList<Entity>(modified.values()), getUserName());
 		} catch (Exception e) {
 			printInternalError(e);
 			logger.error(e);