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

RS when copying course with "broken" topic assignment

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.4.8
    • Fix Version/s: 10.4.9
    • Component/s: Course
    • Labels:
      None

      Description

      "Broken" topic assignment means, that it is possible to remove a group from the course which belongs to a topic. After removing such a group it is not possible to successfully copy the course - a RS occurs:

      >>>stack of 1.cause::java.lang.NullPointerException: null -> at org.olat.group.manager.BusinessGroupServiceImpl.loadBusinessGroup(BusinessGroupServiceImpl.java:353) at 
      org.olat.group.manager.BusinessGroupServiceImpl.addOwners(BusinessGroupServiceImpl.java:850) at 
      org.olat.course.nodes.ProjectBrokerCourseNode.postCopy(ProjectBrokerCourseNode.java:1037)
      

      My suggestion is to check if the group is null. If it doesn't exist, simply add a new group which belongs to the topic. This is the patch:

      diff --git a/src/main/java/org/olat/course/nodes/ProjectBrokerCourseNode.java b/src/main/java/org/olat/course/nodes/ProjectBrokerCourseNode.java
      --- a/src/main/java/org/olat/course/nodes/ProjectBrokerCourseNode.java
      +++ b/src/main/java/org/olat/course/nodes/ProjectBrokerCourseNode.java
      @@ -1031,9 +1031,12 @@
       				Long originalGroupKey = project.getProjectGroup().getKey();
       				Long copiedGroupKey = envMapper.toGroupKeyFromOriginalKey(originalGroupKey);
       				
      +				Identity author = envMapper.getAuthor();
       				BusinessGroup projectGroup = bgs.loadBusinessGroup(copiedGroupKey);
      -				if(envMapper.getAuthor() != null) {
      -					Identity author = envMapper.getAuthor();
      +				if (projectGroup == null) 
      +					projectGroup = projectGroupManager.createProjectGroupFor(projectBrokerId, author, project.getTitle(), project.getDescription(), course.getResourceableId());
      +				
      +				if(author != null) {
       					bgs.addOwners(author, null, Collections.singletonList(author), projectGroup, null);
       				}
       				
      

        Attachments

          Activity

            People

            Assignee:
            srosse Stéphane Rossé
            Reporter:
            stephan Stephan Clemenz
            Tester:
            Stephan Clemenz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 20 minutes
                20m