From d9a35e127006120537543506f2271662a3cfff9e Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 23 Aug 2006 01:29:52 +0000 Subject: [PATCH] Fixed context caching (wasn't using globals) --- lib/accesslib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/accesslib.php b/lib/accesslib.php index d943930b3d..d861a818cd 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -841,6 +841,8 @@ function create_context($aggregatelevel, $instanceid) { */ function get_context_instance($aggregatelevel=NULL, $instance=SITEID) { + global $context_cache, $context_cache_id; + /// If no level is supplied then return the current global context if there is one if (empty($aggregatelevel)) { if (empty($CONTEXT)) { @@ -878,6 +880,8 @@ function get_context_instance($aggregatelevel=NULL, $instance=SITEID) { */ function get_context_instance_by_id($id) { + global $context_cache, $context_cache_id; + if (isset($context_cache_id[$id])) { // Already cached return $context_cache_id[$id]; } -- 2.39.5