Skip to content
Snippets Groups Projects
Commit fc5263a9 authored by srosse's avatar srosse
Browse files

OO-1086: reorder the delete statement of the group related objects

parent 5890b192
No related branches found
No related tags found
No related merge requests found
......@@ -97,6 +97,7 @@ import org.olat.group.right.BGRightManager;
import org.olat.group.right.BGRightsRole;
import org.olat.group.ui.BGMailHelper;
import org.olat.group.ui.edit.BusinessGroupModifiedEvent;
import org.olat.properties.PropertyManager;
import org.olat.repository.RepositoryEntry;
import org.olat.repository.RepositoryEntryShort;
import org.olat.repository.RepositoryManager;
......@@ -131,6 +132,8 @@ public class BusinessGroupServiceImpl implements BusinessGroupService, UserDataD
@Autowired
private RepositoryManager repositoryManager;
@Autowired
private PropertyManager propertyManager;
@Autowired
private BaseSecurity securityManager;
@Autowired
private ContactDAO contactDao;
......@@ -747,10 +750,17 @@ public class BusinessGroupServiceImpl implements BusinessGroupService, UserDataD
//removeFromRepositoryEntrySecurityGroup(group);
// 2) Delete the group areas
areaManager.deleteBGtoAreaRelations(group);
// 3) Delete the group object itself on the database
// 3) Delete the relations
businessGroupRelationDAO.deleteRelations(group);
// 4) delete properties
propertyManager.deleteProperties(null, group, null, null, null);
propertyManager.deleteProperties(null, null, group, null, null);
// 5) delete the publisher attached to this group (e.g. the forum and folder
// publisher)
notificationsManager.deletePublishersOf(group);
// 6) the group
businessGroupDAO.delete(group);
// 4) Delete the associated security groups
// 7) delete the associated security groups
if(group.getOwnerGroup() != null) {
securityManager.deleteSecurityGroup(group.getOwnerGroup());
}
......@@ -762,11 +772,7 @@ public class BusinessGroupServiceImpl implements BusinessGroupService, UserDataD
if (group.getWaitingGroup() != null) {
securityManager.deleteSecurityGroup(group.getWaitingGroup());
}
// delete the publisher attached to this group (e.g. the forum and folder
// publisher)
notificationsManager.deletePublishersOf(group);
dbInstance.commit();
log.audit("Deleted Business Group", group.toString());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment