From 9cf609664eae483ae20c4231d6be7c944ed24a30 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sat, 21 Sep 2019 08:58:17 +1000 Subject: [PATCH] Do no invoke Hooks via UF unless container has been built or it is a hook designed to run without container being built Add in preboot entitytypes and config hooks into the whitelist of hooks that can run without container booted --- CRM/Utils/Hook.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index 76887f2bc3..743a0c4d83 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -188,6 +188,11 @@ abstract class CRM_Utils_Hook { return $event->getReturnValues(); } else { + // We need to ensure tht we will still run known bootstrap related hooks even if the container is not booted. + $prebootContainerHooks = $upgradeFriendlyHooks + ['civicrm_entityTypes', 'civicrm_config']; + if (!\Civi\Core\Container::isContainerBooted() && !in_array($fnSuffix, $prebootContainerHooks)) { + return; + } $count = is_array($names) ? count($names) : $names; return $this->invokeViaUF($count, $arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $fnSuffix); } -- 2.25.1