diff --git a/src/main/java/org/olat/group/manager/BusinessGroupServiceImpl.java b/src/main/java/org/olat/group/manager/BusinessGroupServiceImpl.java index 594934b0db86fe6083460f79fddfcee3a09d28fa..41f847e035ad50df709234b34b8e70c9487f5cbb 100644 --- a/src/main/java/org/olat/group/manager/BusinessGroupServiceImpl.java +++ b/src/main/java/org/olat/group/manager/BusinessGroupServiceImpl.java @@ -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());