diff --git a/dspace-api/src/main/java/org/dspace/content/Community.java b/dspace-api/src/main/java/org/dspace/content/Community.java index 0726686b6b..4071f717e1 100644 --- a/dspace-api/src/main/java/org/dspace/content/Community.java +++ b/dspace-api/src/main/java/org/dspace/content/Community.java @@ -1056,6 +1056,13 @@ public class Community extends DSpaceObject if (parent != null) { + // remove the subcommunities first + Community[] subcommunities = getSubcommunities(); + for (int i = 0; i < subcommunities.length; i++) + { + subcommunities[i].delete(); + } + // now let the parent remove the community parent.removeSubcommunity(this); return; @@ -1085,12 +1092,12 @@ public class Community extends DSpaceObject removeCollection(cols[i]); } - // Remove subcommunities + // delete subcommunities Community[] comms = getSubcommunities(); for (int j = 0; j < comms.length; j++) { - removeSubcommunity(comms[j]); + comms[j].delete(); } // Remove the logo diff --git a/dspace/CHANGES b/dspace/CHANGES index d6f142d9b7..158c741285 100644 --- a/dspace/CHANGES +++ b/dspace/CHANGES @@ -16,6 +16,7 @@ (Claudia Juergen) - [DS-569] Trailing white spaces lead to wrong order of texts in browse +- [DS-596] Cannot Delete Community which has two or more levels of SubCommunities (Erick Rocha Fonseca, Claudia Juergen) - [DS-563] Brazilian Portuguese (pt_BR) translation for XML-UI 1.6.2