From: Tim Otten Date: Tue, 7 Mar 2017 08:00:03 +0000 (-0800) Subject: CRM-19813 - CRM_Utils_Hook::container() - Continue using legacy hooks X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=63b18534a4aa182f896d15aafa8f3ca7564ecab4;p=civicrm-core.git CRM-19813 - CRM_Utils_Hook::container() - Continue using legacy hooks --- 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'); } /**