From 6b4bec74ed791a26699270a5ffe4a21dd9f005ef Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 26 Apr 2018 23:44:55 -0400 Subject: [PATCH] Flush versionCheck cache when upgrading --- CRM/Upgrade/Form.php | 3 +++ CRM/Utils/VersionCheck.php | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/CRM/Upgrade/Form.php b/CRM/Upgrade/Form.php index 8fbc476e7b..c6a3cca9a9 100644 --- a/CRM/Upgrade/Form.php +++ b/CRM/Upgrade/Form.php @@ -738,6 +738,9 @@ SET version = '$version' $config = CRM_Core_Config::singleton(); $config->cleanupCaches(1); + $versionCheck = new CRM_Utils_VersionCheck(); + $versionCheck->flushCache(); + // Rebuild all triggers and re-enable logging if needed $logging = new CRM_Logging_Schema(); $logging->fixSchemaDifferences(); diff --git a/CRM/Utils/VersionCheck.php b/CRM/Utils/VersionCheck.php index 740dd2f04e..5c9ba7cd11 100644 --- a/CRM/Utils/VersionCheck.php +++ b/CRM/Utils/VersionCheck.php @@ -336,6 +336,15 @@ class CRM_Utils_VersionCheck { } } + /** + * Removes cached version info. + */ + public function flushCache() { + if (file_exists($this->cacheFile)) { + unlink($this->cacheFile); + } + } + /** * Lookup version_check scheduled job */ -- 2.25.1