From 1a748db10b95d9c4038c942cf21e0da0feff6b7b Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Wed, 7 Aug 2013 08:49:17 +1200 Subject: [PATCH] clear course cache during upgrade --- locallib.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/locallib.php b/locallib.php index 4b60f9a..d26e464 100644 --- a/locallib.php +++ b/locallib.php @@ -1398,4 +1398,11 @@ function attforblock_upgrade() { // Now convert module record. $module->name = 'attendance'; $DB->update_record('modules', $module); + + // Clear cache for courses with attendances. + $attendances = $DB->get_recordset('attendance', array(), '', 'courseid'); + foreach ($attendances as $attendance) { + rebuild_course_cache($attendance->courseid, true); + } + $attendances->close(); } \ No newline at end of file