[DS-596] Cannot Delete Community which has two or more levels of SubCommunities

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5298 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Claudia Juergen
2010-08-27 13:13:19 +00:00
parent 541d48f810
commit 633faec714
2 changed files with 10 additions and 2 deletions

View File

@@ -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