From 24dedb968001066c954a6f1065601bbe4bae03f2 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Mon, 13 May 2013 10:17:04 +1200 Subject: [PATCH] MDL-39526 cache: purged when upgrade finished --- lib/upgradelib.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/upgradelib.php b/lib/upgradelib.php index 3880d474c3d..c1ada2eb91a 100644 --- a/lib/upgradelib.php +++ b/lib/upgradelib.php @@ -1299,6 +1299,12 @@ function upgrade_finished($continueurl=null) { if (!empty($CFG->upgraderunning)) { unset_config('upgraderunning'); + // We have to forcefully purge the caches using the writer here. + // This has to be done after we unset the config var. If someone hits the site while this is set they will + // cause the config values to propogate to the caches. + // Caches are purged after the last step in an upgrade but there is several code routines that exceute between + // then and now that leaving a window for things to fall out of sync. + cache_helper::purge_all(true); upgrade_setup_debug(false); ignore_user_abort(false); if ($continueurl) {