Permalink
Browse files

Simulate a remove event at the site on deletion of a top level community

Fixes DS-1966
  • Loading branch information...
1 parent fb61ed0 commit fe16267d8f5549b0f1c72c4d1cc109d3de5d2b7b @pnbecker pnbecker committed Apr 9, 2014
Showing with 8 additions and 1 deletion.
  1. +8 −1 dspace-api/src/main/java/org/dspace/content/Community.java
@@ -1091,8 +1091,15 @@ public void delete() throws SQLException, AuthorizeException, IOException
// will call rawDelete() before removing the linkage
Community parent = getParentCommunity();
- if (parent != null)
+ if (parent == null)
{
+ // if removing a top level Community, simulate a REMOVE event at the Site.
+ if (getParentCommunity() == null)
+ {
+ ourContext.addEvent(new Event(Event.REMOVE, Constants.SITE, Site.SITE_ID,
+ Constants.COMMUNITY, getID(), getHandle()));
+ }
+ } else {
// remove the subcommunities first
Community[] subcommunities = getSubcommunities();
for (int i = 0; i < subcommunities.length; i++)

0 comments on commit fe16267

Please sign in to comment.