mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-19288 fixed limiting cached context - array_shift() was breaking array keys; merged from MOODLE_19_STABLE
This commit is contained in:
parent
074d3e8190
commit
56f3599bb9
@ -235,7 +235,8 @@ function cache_context($context) {
|
||||
// If there are too many items in the cache already, remove items until
|
||||
// there is space
|
||||
while (count($ACCESSLIB_PRIVATE->contextsbyid) >= MAX_CONTEXT_CACHE_SIZE) {
|
||||
$first = array_shift($ACCESSLIB_PRIVATE->contextsbyid);
|
||||
$first = reset($ACCESSLIB_PRIVATE->contextsbyid);
|
||||
unset($ACCESSLIB_PRIVATE->contextsbyid[$first->id]);
|
||||
unset($ACCESSLIB_PRIVATE->contexts[$first->contextlevel][$first->instanceid]);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user