From 12e01332fa1de167d87831a60d0f3d28d9f39ae1 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 2 Jan 2017 23:54:43 -0800 Subject: [PATCH] CRM-19824 - Container::loadContainer - Always compile listeners In the typical (cache-enabled) flow, the container is compiled to identify any services tagged with `kernel.event_subscriber`. However, if you disable caching, then it skipped compilation, and it failed to identify all the listeners. With this patch, we always detect the listeners -- even if caching is disabled. (This issue identified while working on tests for CRM-19690. --- Civi/Core/Container.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Civi/Core/Container.php b/Civi/Core/Container.php index 20733e2980..bcbf79af23 100644 --- a/Civi/Core/Container.php +++ b/Civi/Core/Container.php @@ -69,7 +69,9 @@ class Container { // In pre-installation environments, don't bother with caching. if (!defined('CIVICRM_TEMPLATE_COMPILEDIR') || !defined('CIVICRM_DSN') || $cacheMode === 'never' || \CRM_Utils_System::isInUpgradeMode()) { - return $this->createContainer(); + $containerBuilder = $this->createContainer(); + $containerBuilder->compile(); + return $containerBuilder; } $envId = \CRM_Core_Config_Runtime::getId(); -- 2.25.1