-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 10.3.6
-
Component/s: None
-
Labels:None
-
Funded by:
When copying a course with a configured Date Enrollment, a RS occurs when opening the DEN course node in the copied course if the original course is deleted.
The cause is that in course node configuration the course resourceable id and the course node id of the DEN node is stored. When copying a course those ids are copied also. If the original course is being deleted, a RS occurs. If the original course still exist, the DEN node is being displayed with data from the original course (Ugh).
I made a quick fix which seems to work:
diff --git a/src/main/java/de/bps/course/nodes/DENCourseNode.java b/src/main/java/de/bps/course/nodes/DENCourseNode.java --- a/src/main/java/de/bps/course/nodes/DENCourseNode.java +++ b/src/main/java/de/bps/course/nodes/DENCourseNode.java @@ -104,7 +104,7 @@ String message = trans.translate("guestnoaccess.message"); controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message); } else { - controller = new DENRunController(ureq, wControl, getModuleConfiguration(), this); + controller = new DENRunController(ureq, wControl, getModuleConfiguration(), userCourseEnv, this); } Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_en_icon"); diff --git a/src/main/java/de/bps/course/nodes/den/DENRunController.java b/src/main/java/de/bps/course/nodes/den/DENRunController.java --- a/src/main/java/de/bps/course/nodes/den/DENRunController.java +++ b/src/main/java/de/bps/course/nodes/den/DENRunController.java @@ -47,6 +47,7 @@ import org.olat.course.ICourse; import org.olat.course.groupsandrights.CourseGroupManager; import org.olat.course.nodes.ObjectivesHelper; +import org.olat.course.run.userview.UserCourseEnvironment; import org.olat.modules.ModuleConfiguration; import de.bps.course.nodes.DENCourseNode; @@ -88,10 +89,10 @@ * @param denCourseNode * @param userCourseEnv */ - public DENRunController(UserRequest ureq, WindowControl wControl, ModuleConfiguration moduleConfig, DENCourseNode denCourseNode) { + public DENRunController(UserRequest ureq, WindowControl wControl, ModuleConfiguration moduleConfig, UserCourseEnvironment userCourseEnv, DENCourseNode denCourseNode) { super(ureq, wControl); this.courseNode = denCourseNode; - this.ores = CourseFactory.loadCourse((Long)moduleConfig.get(DENCourseNode.CONF_COURSE_ID)); + this.ores = CourseFactory.loadCourse(userCourseEnv.getCourseEnvironment().getCourseResourceableId()); this.cancelEnrollEnabled = ((Boolean) moduleConfig.get(DENCourseNode.CONF_CANCEL_ENROLL_ENABLED)).booleanValue(); denManager = DENManager.getInstance();