mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
accesslib: get_context_instance() - ignore clearcache
"cleacache" is no longer needed, and nothing is calling it. Still - handle it as a noop to avoid erroring out with custom/contrib code.
This commit is contained in:
parent
564870b7b8
commit
56743fabc9
1 changed files with 6 additions and 8 deletions
|
@ -2372,14 +2372,12 @@ function get_context_instance($contextlevel=NULL, $instance=0) {
|
||||||
global $context_cache, $context_cache_id, $CONTEXT;
|
global $context_cache, $context_cache_id, $CONTEXT;
|
||||||
static $allowed_contexts = array(CONTEXT_SYSTEM, CONTEXT_PERSONAL, CONTEXT_USER, CONTEXT_COURSECAT, CONTEXT_COURSE, CONTEXT_GROUP, CONTEXT_MODULE, CONTEXT_BLOCK);
|
static $allowed_contexts = array(CONTEXT_SYSTEM, CONTEXT_PERSONAL, CONTEXT_USER, CONTEXT_COURSECAT, CONTEXT_COURSE, CONTEXT_GROUP, CONTEXT_MODULE, CONTEXT_BLOCK);
|
||||||
|
|
||||||
// Yu: Separating site and site course context - removed CONTEXT_COURSE override when SITEID
|
if ($contextlevel === 'clearcache') {
|
||||||
|
// TODO: Remove for v2.0
|
||||||
// fix for MDL-9016
|
// No longer needed, but we'll catch it to avoid erroring out on custom code.
|
||||||
if ($contextlevel == 'clearcache') {
|
// This used to be a fix for MDL-9016
|
||||||
// Clear ALL cache
|
// "Restoring into existing course, deleting first
|
||||||
$context_cache = array();
|
// deletes context and doesn't recreate it"
|
||||||
$context_cache_id = array();
|
|
||||||
$CONTEXT = '';
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue