From: Coleman Watts Date: Tue, 26 Aug 2014 13:30:37 +0000 (+0100) Subject: CRM-15156 - Clear cms resource cache during upgrade X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d4e8e63ffcf88542b726a084d9381701f5eb2985;p=civicrm-core.git CRM-15156 - Clear cms resource cache during upgrade --- 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(); + } }