From 77d656e1efb3663a471b17aacb6645fda5f35a0d Mon Sep 17 00:00:00 2001 From: Dieter Holvoet Date: Mon, 31 Jan 2022 10:35:31 +0100 Subject: [PATCH] Ignore services on invalid reference --- src/Drupal/FindCommandsCompilerPass.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Drupal/FindCommandsCompilerPass.php b/src/Drupal/FindCommandsCompilerPass.php index ccfaa354db..598642b709 100644 --- a/src/Drupal/FindCommandsCompilerPass.php +++ b/src/Drupal/FindCommandsCompilerPass.php @@ -5,6 +5,7 @@ use Drush\Drush; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Reference; /** @@ -64,7 +65,7 @@ public function process(ContainerBuilder $container): void Drush::logger()->debug(dt("Found tagged service !id", ['!id' => $id])); $definition->addMethodCall( 'addCommandReference', - [new Reference($id)] + [new Reference($id, ContainerInterface::IGNORE_ON_INVALID_REFERENCE)] ); } }