Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-1086

RS when deleting pre9.4 groups with display members configured

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 9.4.0
    • Fix Version/s: 9.4.0
    • Component/s: Group
    • Labels:
      None
    • Environment:

      DB: PostgreSQL

      Description

      It seems that the upgrade script for 9.4 adds the category named configMoved to group property named displayMembers.

      When deleting a group which has been updated by the script, a Redscreen appears. The cause is:

      org.postgresql.util.PSQLException: FEHLER: Aktualisieren oder Löschen in Tabelle »o_gp_business« verletzt Fremdschlüssel-Constraint »fkb60b1ba5190e5« von Tabelle »o_property«
      

      The method deleteBusinessGroup() only deletes the tools properties and assumes that no other properties exist.

      I'm not 100% sure but this patch helps:

      diff -r 7d05e7182d8a src/main/java/org/olat/group/manager/BusinessGroupServiceImpl.java
      --- a/src/main/java/org/olat/group/manager/BusinessGroupServiceImpl.java	Wed Apr 30 10:12:44 2014 +0200
      +++ b/src/main/java/org/olat/group/manager/BusinessGroupServiceImpl.java	Mon May 05 14:53:01 2014 +0200
      @@ -97,6 +97,7 @@
       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;
      @@ -742,7 +743,11 @@
       			
       			// 1) Delete all group properties
       			CollaborationTools ct = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(group);
      -			ct.deleteTools(group);// deletes everything concerning properties&collabTools
      +			// deletes everything concerning collabTools
      +			ct.deleteTools(group);
      +			// deletes all properties
      +			PropertyManager pm = PropertyManager.getInstance();
      +			pm.deleteProperties(null, group, null, null, null);
       			// 1.c)delete user in security groups
       			//removeFromRepositoryEntrySecurityGroup(group);
       			// 2) Delete the group areas
      
      

        Attachments

          Activity

            People

            Assignee:
            srosse Stéphane Rossé
            Reporter:
            stephan Stephan Clemenz
            Tester:
            Florian Gnägi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: