From d4e8e63ffcf88542b726a084d9381701f5eb2985 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 26 Aug 2014 14:30:37 +0100 Subject: [PATCH] CRM-15156 - Clear cms resource cache during upgrade --- CRM/Core/Resources.php | 2 ++ CRM/Utils/System/Base.php | 7 +++++++ CRM/Utils/System/DrupalBase.php | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/CRM/Core/Resources.php b/CRM/Core/Resources.php index b1f0df1c90..876284a388 100644 --- a/CRM/Core/Resources.php +++ b/CRM/Core/Resources.php @@ -436,6 +436,8 @@ class CRM_Core_Resources { public function resetCacheCode() { $this->setCacheCode(CRM_Utils_String::createRandom(5, CRM_Utils_String::ALPHANUMERIC)); + // Also flush cms resource cache if needed + CRM_Core_Config::singleton()->userSystem->clearResourceCache(); } /** diff --git a/CRM/Utils/System/Base.php b/CRM/Utils/System/Base.php index a92882a41d..e52558d3b7 100644 --- a/CRM/Utils/System/Base.php +++ b/CRM/Utils/System/Base.php @@ -183,6 +183,13 @@ abstract class CRM_Utils_System_Base { // nullop by default } + /** + * Flush css/js caches + */ + function clearResourceCache() { + // nullop by default + } + /** * Return default Site Settings * diff --git a/CRM/Utils/System/DrupalBase.php b/CRM/Utils/System/DrupalBase.php index 7452ab8c7b..3fc5054e03 100644 --- a/CRM/Utils/System/DrupalBase.php +++ b/CRM/Utils/System/DrupalBase.php @@ -283,4 +283,11 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { watchdog('civicrm', $message, NULL, WATCHDOG_DEBUG); } } + + /** + * Flush css/js caches + */ + function clearResourceCache() { + _drupal_flush_css_js(); + } } -- 2.25.1