From a19c781aa7ccd2c19e701044873575ea67fa0f7a Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 7 Apr 2021 22:33:47 -0400 Subject: [PATCH] Afform - Refresh assetBuilder when saving a form On sites with caching enabled, changes were not showing until a manual flush --- Civi/Angular/Manager.php | 2 ++ ext/afform/core/Civi/Api4/Utils/AfformSaveTrait.php | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Civi/Angular/Manager.php b/Civi/Angular/Manager.php index 7a075d585b..dacd8f3062 100644 --- a/Civi/Angular/Manager.php +++ b/Civi/Angular/Manager.php @@ -70,6 +70,8 @@ class Manager { $this->cache->clear(); $this->modules = NULL; $this->changeSets = NULL; + // Force-refresh assetBuilder files + \Civi::container()->get('asset_builder')->clear(FALSE); return $this; } diff --git a/ext/afform/core/Civi/Api4/Utils/AfformSaveTrait.php b/ext/afform/core/Civi/Api4/Utils/AfformSaveTrait.php index 18f9ced57f..bee09ea626 100644 --- a/ext/afform/core/Civi/Api4/Utils/AfformSaveTrait.php +++ b/ext/afform/core/Civi/Api4/Utils/AfformSaveTrait.php @@ -79,7 +79,6 @@ trait AfformSaveTrait { \CRM_Core_Menu::store(); \CRM_Core_BAO_Navigation::resetNavigation(); } - // FIXME if asset-caching is enabled, then flush the asset cache. $item['module_name'] = _afform_angular_module_name($item['name'], 'camel'); $item['directive_name'] = _afform_angular_module_name($item['name'], 'dash'); -- 2.25.1