diff --git a/src/main/java/org/olat/course/learningpath/manager/LearningPathServiceImpl.java b/src/main/java/org/olat/course/learningpath/manager/LearningPathServiceImpl.java index ae31be71419d48cb3f9b2b5a5ef69f935fa2424a..186c4364bb6a2a42048fdf6ee3f23a3ba2fdacc0 100644 --- a/src/main/java/org/olat/course/learningpath/manager/LearningPathServiceImpl.java +++ b/src/main/java/org/olat/course/learningpath/manager/LearningPathServiceImpl.java @@ -117,8 +117,10 @@ public class LearningPathServiceImpl implements LearningPathService { TreeVisitor tv = new TreeVisitor(new PostMigrationVisitor(registry), course.getEditorTreeModel().getRootNode(), false); tv.visitAll(); + tv = new TreeVisitor(new PostMigrationVisitor(registry), course.getRunStructure().getRootNode(), false); + tv.visitAll(); - CourseFactory.saveCourseEditorTreeModel(course.getResourceableId()); + CourseFactory.saveCourse(course.getResourceableId()); CourseFactory.closeCourseEditSession(course.getResourceableId(), true); return lpEntry; } diff --git a/src/main/java/org/olat/course/learningpath/manager/PostMigrationVisitor.java b/src/main/java/org/olat/course/learningpath/manager/PostMigrationVisitor.java index 6167e9055abd7995cb3691694b44959c28c31904..c37093c29d9133f9cb6a28f18c15ee11307ef4e8 100644 --- a/src/main/java/org/olat/course/learningpath/manager/PostMigrationVisitor.java +++ b/src/main/java/org/olat/course/learningpath/manager/PostMigrationVisitor.java @@ -41,9 +41,15 @@ public class PostMigrationVisitor implements Visitor { @Override public void visit(INode node) { + CourseNode courseNode = null; if (node instanceof CourseEditorTreeNode) { CourseEditorTreeNode courseEditorTreeNode = (CourseEditorTreeNode)node; - CourseNode courseNode = courseEditorTreeNode.getCourseNode(); + courseNode = courseEditorTreeNode.getCourseNode(); + } + if (node instanceof CourseNode) { + courseNode = (CourseNode)node; + } + if (courseNode != null) { LearningPathNodeHandler lpHandler = registry.getLearningPathNodeHandler(courseNode); lpHandler.onMigrated(courseNode); }