In course/edit.php, there is some code that call require_login() in the following way:
$course = course_get_format($id)->get_course();
|
require_login($course);
|
At first, this looks harmless, but it actually causes a really odd edge case. Basically the above code populates the $COURSE global with the course format options.
At first, this doesn't really harm anything, until course caches are cleared. Once cleared, the format_base::get_course calls get_course() which reads the course from the $COURSE global. Then it reports that the course format options are not valid because the appear to be the same as a field in the course table.
I'm not sure if this can be replicated with stock Moodle, but we have a customization listening to the course_updated event which is fired after caches are cleared and the customization then uses the format_base API.
So, my two suggested solutions are:
- Ensure that when require_login() is called, it is not using a $course object from format_base::get_course
- Ensure that when $COURSE global is set, it doesn't include course format options.
The latter is probably more appealing since 3rd party code could be doing this. Of course, other solutions are probably out there!
- duplicates
-
MDL-41384 Debugging message regarding numsections in course format when upgrading
-
- Closed
-
- has a non-specific relationship to
-
MDL-41384 Debugging message regarding numsections in course format when upgrading
-
- Closed
-
- has been marked as being related by
-
MDL-43668 Can get dirty read from get_course after a update_course call
-
- Closed
-