]> git.mjollnir.org Git - moodle.git/commitdiff
course/edit: mark the course contextpath as dirty to force a reload
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:13:20 +0000 (07:13 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:13:20 +0000 (07:13 +0000)
Combined with the path creation in create_context() we can now create
a course, enter and edit it immediately. Amazing.

Like - 21st century technology.

course/edit.php

index c7f3c052ebf4e5815353f8e923e9d248d3dd9fbc..f25fb849f57437412ec69b8aa247ec2d4533a311 100644 (file)
                 role_assign($CFG->creatornewroleid, $USER->id, 0, $context->id);
             }
 
+            // ensure we can use the course right after creating it
+            // this means trigger a reload of accessinfo...
+            mark_context_dirty($context->path);
+
             if ($data->metacourse and has_capability('moodle/course:managemetacourse', $context)) {
                 // Redirect users with metacourse capability to student import
                 redirect($CFG->wwwroot."/course/importstudents.php?id=$course->id");