From 56743fabc93d4a3c5c3dfb488cf69a64e07091ba Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Wed, 19 Sep 2007 07:23:41 +0000 Subject: [PATCH] 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. --- lib/accesslib.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/accesslib.php b/lib/accesslib.php index 0a8aabe4fc..528e261c9a 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -2372,14 +2372,12 @@ function get_context_instance($contextlevel=NULL, $instance=0) { 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); - // Yu: Separating site and site course context - removed CONTEXT_COURSE override when SITEID - - // fix for MDL-9016 - if ($contextlevel == 'clearcache') { - // Clear ALL cache - $context_cache = array(); - $context_cache_id = array(); - $CONTEXT = ''; + if ($contextlevel === 'clearcache') { + // TODO: Remove for v2.0 + // No longer needed, but we'll catch it to avoid erroring out on custom code. + // This used to be a fix for MDL-9016 + // "Restoring into existing course, deleting first + // deletes context and doesn't recreate it" return false; } -- 2.39.5