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)] ); } }