Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.7.2
-
MOODLE_37_STABLE
-
MOODLE_37_STABLE, MOODLE_38_STABLE
-
MDL-66936-master -
Description
A URL resource with URL variables configured will cause a coding exception when the course modinfo cache is rebuilt outside a page view, like by AJAX call.
To reproduce:
- Add a URL resource to a course:
- External URL: https://example.org/
- URL variables: foo = Course id
- With AJAX course editing enabled, move the URL resource right. (This invalidates the course modinfo cache.)
- Move the URL resource right again. Observe the error message:
Coding error detected, it must be fixed by a programmer: $PAGE->context was not set. You may have forgotten to call require_login() or $PAGE->set_context()
|
Error code: codingerror
|
* line 498 of /lib/pagelib.php: coding_exception thrown
|
* line 830 of /lib/pagelib.php: call to moodle_page->magic_get_context()
|
* line 1456 of /lib/weblib.php: call to moodle_page->__get()
|
* line 463 of /mod/url/locallib.php: call to format_string()
|
* line 109 of /mod/url/locallib.php: call to url_get_variable_values()
|
* line 247 of /mod/url/lib.php: call to url_get_full_url()
|
* line 466 of /course/lib.php: call to url_get_coursemodule_info()
|
* line 670 of /lib/modinfolib.php: call to get_array_of_activities()
|
* line 462 of /lib/modinfolib.php: call to course_modinfo::inner_build_course_cache()
|
* line 417 of /lib/modinfolib.php: call to course_modinfo->__construct()
|
* line 2168 of /lib/modinfolib.php: call to course_modinfo::instance()
|
* line 2242 of /lib/modinfolib.php: call to get_fast_modinfo()
|
* line 3494 of /course/externallib.php: call to get_course_and_cm_from_cmid()
|
* line 244 of /lib/externallib.php: call to core_course_external::edit_module()
|
* line 79 of /lib/ajax/service.php: call to external_api::call_external_function()
|