-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 10.4.11
-
Fix Version/s: 10.5
-
Component/s: Course
-
Labels:None
-
Funded by:
In certain cases it's possible that no account manager group exists for a project broker, but a related property exists in the database with a null value for the group key. In course run this doesn't matter but when copying the course entering the editor and configuring the project broker, a new property is created. After that, two properties exist which results in a sleeping lion (AssertException: findProperty found more than one properties for...).
If the group key of the property is null, a new group is created. I check if a property exists and if yes, the property is updated with the new group key instead of creating a new property.
diff --git a/src/main/java/org/olat/course/nodes/projectbroker/service/ProjectGroupManagerImpl.java b/src/main/java/org/olat/course/nodes/projectbroker/service/ProjectGroupManagerImpl.java --- a/src/main/java/org/olat/course/nodes/projectbroker/service/ProjectGroupManagerImpl.java +++ b/src/main/java/org/olat/course/nodes/projectbroker/service/ProjectGroupManagerImpl.java @@ -123,7 +123,14 @@ } logDebug("createAndPersistBusinessGroup businessgroup=" + accountManagerGroup); - saveAccountManagerGroupKey(accountManagerGroup.getKey(), cpm, courseNode); + if (accountManagerGroupProperty != null) { + accountManagerGroupProperty.setLongValue(accountManagerGroup.getKey()); + cpm.updateProperty(accountManagerGroupProperty); + logDebug("updateAccountManagerGroupKey accountManagerGroupKey=" + accountManagerGroup.getKey()); + } + else { + saveAccountManagerGroupKey(accountManagerGroup.getKey(), cpm, courseNode); + } logDebug("created account-manager default businessgroup=" + accountManagerGroup); } return accountManagerGroup;