Ensure dispatcher has loaded listeners
authoreileen <emcnaughton@wikimedia.org>
Wed, 17 Feb 2021 06:26:46 +0000 (19:26 +1300)
committereileen <emcnaughton@wikimedia.org>
Wed, 17 Feb 2021 06:26:46 +0000 (19:26 +1300)
Civi/Core/Container.php

index 7d5e6b8baf17b20891bbee406377e620f0dc0951..5bc005b42744c548d49ac18cef676ffade34dbdc 100644 (file)
@@ -569,6 +569,9 @@ class Container {
         $container->set($name, $obj);
       }
       \Civi::$statics[__CLASS__]['container'] = $container;
+      // Ensure api factory has loaded (in case other roots have been bypassed)
+      $container->get('dispatcher');
+
     }
     else {
       $bootServices['dispatcher.boot']->setDispatchPolicy($mainDispatchPolicy);