MDL-41746 External api: Allow multiple calls to validate_context at different levels

(Only from webservices)
This commit is contained in:
Damyon Wiese
2014-06-23 13:39:21 +08:00
committed by Marina Glancy
parent 9134f3f0df
commit 9c8c5f2d01
+5 -1
View File
@@ -965,7 +965,11 @@ class moodle_page {
} else {
// We do not want devs to do weird switching of context levels on the fly because we might have used
// the context already such as in text filter in page title.
debugging("Coding problem: unsupported modification of PAGE->context from {$current} to {$context->contextlevel}");
// This is explicitly allowed for webservices though which may
// call "external_api::validate_context on many contexts in a single request.
if (!WS_SERVER) {
debugging("Coding problem: unsupported modification of PAGE->context from {$current} to {$context->contextlevel}");
}
}
}