From 76dca235cba2575b10b225c31bd55391c01497de Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 9 Jul 2014 20:56:08 +0100 Subject: [PATCH] CRM-14949 - Flush dynamic resources when clearing caches --- CRM/Core/BAO/WordReplacement.php | 2 ++ CRM/Core/Invoke.php | 3 +++ CRM/Utils/File.php | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CRM/Core/BAO/WordReplacement.php b/CRM/Core/BAO/WordReplacement.php index 14b6083a4c..9da2ebf36a 100644 --- a/CRM/Core/BAO/WordReplacement.php +++ b/CRM/Core/BAO/WordReplacement.php @@ -207,6 +207,8 @@ WHERE domain_id = %1 CRM_Core_BAO_Navigation::resetNavigation(); // Clear js string cache CRM_Core_Resources::singleton()->flushStrings(); + // Clear dynamic js files which may contain localization + CRM_Utils_File::flushDynamicResources(); return TRUE; } diff --git a/CRM/Core/Invoke.php b/CRM/Core/Invoke.php index bd60f01405..44936afb14 100644 --- a/CRM/Core/Invoke.php +++ b/CRM/Core/Invoke.php @@ -402,6 +402,9 @@ class CRM_Core_Invoke { // also rebuild word replacement cache CRM_Core_BAO_WordReplacement::rebuild(); + // Clear dynamic js files + CRM_Utils_File::flushDynamicResources(); + CRM_Core_BAO_Setting::updateSettingsFromMetaData(); CRM_Core_Resources::singleton()->resetCacheCode(); CRM_Case_XMLRepository::singleton(TRUE); diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index c459fa0cc8..3fdc463c2c 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -724,7 +724,7 @@ HTACCESS; } /** - * Flush the dynamic resource directory + * Delete all files from the dynamic resource directory */ static function flushDynamicResources() { $files = glob(self::dynamicResourcePath('*')); -- 2.25.1