From 756d9e0dbbe4ff66d2568f02a8ee1f152bd9c5e5 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Tue, 8 Dec 2020 12:02:23 +1100 Subject: [PATCH] dev/core#2232 Permit hook_civicrm_container and some other prebootish hooks to run during upgrade and clear out the asset builder cache post upgrade --- CRM/Upgrade/DispatchPolicy.php | 4 ++++ CRM/Upgrade/Form.php | 2 ++ 2 files changed, 6 insertions(+) diff --git a/CRM/Upgrade/DispatchPolicy.php b/CRM/Upgrade/DispatchPolicy.php index de0fa72511..a67c17e2ae 100644 --- a/CRM/Upgrade/DispatchPolicy.php +++ b/CRM/Upgrade/DispatchPolicy.php @@ -59,6 +59,10 @@ class CRM_Upgrade_DispatchPolicy { // It's more restrictive, preventing interference from unexpected callpaths. $policies['upgrade.main'] = [ 'hook_civicrm_config' => 'run', + 'hook_civicrm_container' => 'run', + 'hook_civicrm_alterSettingsFolders' => 'run', + 'hook_civicrm_alterSettingsMetaData' => 'run', + 'hook_civicrm_permission' => 'run', '/^hook_civicrm_(pre|post)$/' => 'drop', '/^hook_civicrm_/' => $strict ? 'warn-drop' : 'drop', '/^civi\./' => 'run', diff --git a/CRM/Upgrade/Form.php b/CRM/Upgrade/Form.php index 2ab3c1c7e8..5fb36b6475 100644 --- a/CRM/Upgrade/Form.php +++ b/CRM/Upgrade/Form.php @@ -780,6 +780,8 @@ SET version = '$version' // Rebuild all triggers and re-enable logging if needed $logging = new CRM_Logging_Schema(); $logging->fixSchemaDifferences(); + // Force a rebuild of CiviCRM asset cache in case things have changed. + \Civi::service('asset_builder')->clear(FALSE); } /** -- 2.25.1