-
Bug
-
Resolution: Fixed
-
Minor
-
3.1
-
MOODLE_31_STABLE
-
MOODLE_31_STABLE
-
MDL-54098-master -
With MDL-53772, validate_context() became better and now it supports any context. That should lead to all current uses of require_login(false...) and/or PAGE->set_context() within external functions to be killed and replaced (if missing) by validate_context().
A quick search, returns a bunch (note the regexp maybe innacurate/incomplete):
$ ag 'require_login\(|set_context\(' | grep external
|
badges/external.php:43: require_login();
|
badges/external.php:49: require_login();
|
badges/external.php:78:$PAGE->set_context(context_system::instance());
|
blog/external_blog_edit.php:32:require_login();
|
blog/external_blog_edit.php:46:$PAGE->set_context(context_user::instance($USER->id));
|
blog/external_blogs.php:30:require_login();
|
blog/external_blogs.php:32:$PAGE->set_context(context_user::instance($USER->id));
|
enrol/externallib.php:656: require_login(null, false, null, false, true);
|
enrol/guest/classes/external.php:74: require_login(null, false, null, false, true);
|
enrol/self/externallib.php:71: require_login(null, false, null, false, true);
|
enrol/self/externallib.php:150: require_login(null, false, null, false, true);
|
lib/externallib.php:480: require_login($course, false, $cm, false, true);
|
lib/externallib.php:481: $PAGE->set_context($context);
|
mod/lti/classes/external.php:641: $PAGE->set_context($context);
|
mod/lti/externalregistrationreturn.php:36:require_login(0, false);
|
mod/lti/externalregistrationreturn.php:42:$PAGE->set_context($systemcontext);
|
question/classes/external.php:91: require_login(null, false, null, false, true);
|
tag/classes/external.php:194: require_login(null, false, null, false, true);
|
tag/classes/external.php:303: require_login(null, false, null, false, true);
|
So, this is about to kill all the uglies and verify everything continues working the same. 3.1 only. Old branches will need to continue using the old (ugly) approach.
Ciao
- has a non-specific relationship to
-
MDL-53772 Fix $PAGE->context issues with validate_context()
-
- Closed
-