Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #517 from pnbecker/DS-1966

Simulate a remove event at the site on deletion of a top level community
  • Loading branch information...
commit 8f311956af087480efaa6631fe3d5197d6f0dc4a 2 parents 454061f + fe16267
@mwoodiupui mwoodiupui authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 dspace-api/src/main/java/org/dspace/content/Community.java
View
9 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++)
Please sign in to comment.
Something went wrong with that request. Please try again.