MDL-61519 coursecat: Reset the coursecat cache on enrolment

This commit is contained in:
Andrew Nicols 2018-03-21 08:48:42 +08:00
parent bb0ca2c4a3
commit b30b66c57e
3 changed files with 5 additions and 1 deletions

View File

@ -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;

View File

@ -134,6 +134,7 @@ $definitions = array(
'simpledata' => true,
'invalidationevents' => array(
'changesincoursecat',
'changesincategoryenrolment',
),
'ttl' => 900,
),

View File

@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2018031600.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2018031601.00; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.