[DS-2996] Fix retrieval of hierarchical of communities from a collection.

This commit is contained in:
KevinVdV
2016-02-24 12:47:49 +01:00
parent f495d3d8ee
commit e325a84b13
20 changed files with 65 additions and 38 deletions

View File

@@ -232,11 +232,7 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
List<Community> result = new ArrayList<>();
List<Collection> collections = item.getCollections();
for (Collection collection : collections) {
List<Community> owningCommunities = collection.getCommunities();
for (Community community : owningCommunities) {
result.add(community);
result.addAll(communityService.getAllParents(context, community));
}
result.addAll(communityService.getAllParents(context, collection));
}
return result;