Entities features: update the item metadata on relationship create/delete also when not using REST

on update this is causing problems with the place changes
This commit is contained in:
Ben Bosman
2020-06-25 18:10:16 +02:00
parent b39facf1d1
commit 612acbdc36

View File

@@ -90,6 +90,7 @@ public class RelationshipServiceImpl implements RelationshipService {
Relationship relationshipToReturn = relationshipDAO.create(context, relationship); Relationship relationshipToReturn = relationshipDAO.create(context, relationship);
updatePlaceInRelationship(context, relationshipToReturn); updatePlaceInRelationship(context, relationshipToReturn);
update(context, relationshipToReturn); update(context, relationshipToReturn);
updateItemsInRelationship(context, relationship);
return relationshipToReturn; return relationshipToReturn;
} else { } else {
throw new AuthorizeException( throw new AuthorizeException(
@@ -307,7 +308,6 @@ public class RelationshipServiceImpl implements RelationshipService {
authorizeService.authorizeActionBoolean(context, relationship.getRightItem(), Constants.WRITE)) { authorizeService.authorizeActionBoolean(context, relationship.getRightItem(), Constants.WRITE)) {
if (isRelationshipValidToCreate(context, relationship)) { if (isRelationshipValidToCreate(context, relationship)) {
relationshipDAO.save(context, relationship); relationshipDAO.save(context, relationship);
updateItemsInRelationship(context, relationship);
} }
} else { } else {
throw new AuthorizeException("You do not have write rights on this relationship's items"); throw new AuthorizeException("You do not have write rights on this relationship's items");