From 63b18534a4aa182f896d15aafa8f3ca7564ecab4 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 7 Mar 2017 00:00:03 -0800 Subject: [PATCH] CRM-19813 - CRM_Utils_Hook::container() - Continue using legacy hooks --- CRM/Utils/Hook.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index aa2f52707c..2636f45275 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -2125,7 +2125,10 @@ abstract class CRM_Utils_Hook { * @see http://symfony.com/doc/current/components/dependency_injection/index.html */ public static function container(\Symfony\Component\DependencyInjection\ContainerBuilder $container) { - self::singleton()->invoke(1, $container, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_container'); + // This hook fires during system bootstrap, after CRM_Extension_System + // initializes but before the container or dispatcher initialize. Therefore, + // we cannot use containerized services (like the dispatcher). + self::singleton()->invokeViaUF(1, $container, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_container'); } /** -- 2.25.1