CRM-15156 - Clear cms resource cache during upgrade
authorColeman Watts <coleman@civicrm.org>
Tue, 26 Aug 2014 13:30:37 +0000 (14:30 +0100)
committerColeman Watts <coleman@civicrm.org>
Tue, 26 Aug 2014 13:30:37 +0000 (14:30 +0100)
CRM/Core/Resources.php
CRM/Utils/System/Base.php
CRM/Utils/System/DrupalBase.php

index b1f0df1c901a19507e8419aa33393f6ee06acbfc..876284a388411283b1bc05eaa382ae9d159586c1 100644 (file)
@@ -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();
   }
 
   /**
index a92882a41d38ec28e43be08eede38e7d6b9b917e..e52558d3b7432ad74d10d5a444da6b6207f200be 100644 (file)
@@ -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
    *
index 7452ab8c7b7d1ec575da823978fda06c0d59aaf8..3fc5054e03973c909bce77d6e926d94bee98455c 100644 (file)
@@ -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();
+  }
 }