From 65fa7c7d15057de2ddd29db0e124a105b7a1f977 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Wed, 21 Mar 2018 08:48:42 +0800 Subject: [PATCH] MDL-61519 coursecat: Reset the coursecat cache on enrolment --- lib/coursecatlib.php | 3 +++ lib/db/caches.php | 1 + version.php | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/coursecatlib.php b/lib/coursecatlib.php index b5fcff4306b..e824b2fb277 100644 --- a/lib/coursecatlib.php +++ b/lib/coursecatlib.php @@ -722,6 +722,9 @@ class coursecat implements renderable, cacheable_object, IteratorAggregate { return; } + // Trigger a purge for all caches listening for changes to category enrolment. + cache_helper::purge_by_event('changesincategoryenrolment'); + if (!$CFG->coursecontact || !in_array($roleid, explode(',', $CFG->coursecontact))) { // The role is not one of course contact roles. return; diff --git a/lib/db/caches.php b/lib/db/caches.php index 73da817cd96..84ccd701f64 100644 --- a/lib/db/caches.php +++ b/lib/db/caches.php @@ -134,6 +134,7 @@ $definitions = array( 'simpledata' => true, 'invalidationevents' => array( 'changesincoursecat', + 'changesincategoryenrolment', ), 'ttl' => 900, ), diff --git a/version.php b/version.php index 23ebf02b0f9..954a0238a31 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2017111302.00; // 20171113 = branching date YYYYMMDD - do not modify! +$version = 2017111302.01; // 20171113 = branching date YYYYMMDD - do not modify! // RR = release increments - 00 in DEV branches. // .XX = incremental changes.