diff --git a/src/Application.php b/src/Application.php index 88d41741e8..0a224de2cf 100644 --- a/src/Application.php +++ b/src/Application.php @@ -405,4 +405,14 @@ public function renderException(\Exception $e, OutputInterface $output) $this->doRenderException($e, $output); } + + /** + * Renders a caught Throwable. Omits the command docs at end. + */ + public function renderThrowable(\Throwable $e, OutputInterface $output): void + { + $output->writeln('', OutputInterface::VERBOSITY_QUIET); + + $this->doRenderThrowable($e, $output); + } } diff --git a/src/Command/RemoteCommandProxy.php b/src/Command/RemoteCommandProxy.php index ef7256d854..ff83f5c17a 100644 --- a/src/Command/RemoteCommandProxy.php +++ b/src/Command/RemoteCommandProxy.php @@ -40,6 +40,9 @@ public function __construct($name, RedispatchHook $redispatchHook) InputArgument::IS_ARRAY, 'Proxy for command arguments' ); + + // The above should be enough but isn't in Drupal 10. + $this->ignoreValidationErrors(); } protected function execute(InputInterface $input, OutputInterface $output): void diff --git a/src/Drupal/Commands/core/DeployHookCommands.php b/src/Drupal/Commands/core/DeployHookCommands.php index f6477eea2d..9bcbb0a761 100644 --- a/src/Drupal/Commands/core/DeployHookCommands.php +++ b/src/Drupal/Commands/core/DeployHookCommands.php @@ -25,8 +25,8 @@ class DeployHookCommands extends DrushCommands implements SiteAliasManagerAwareI public static function getRegistry(): UpdateRegistry { $registry = new class ( - \Drupal::service('app.root'), - \Drupal::service('site.path'), + \Drupal::getContainer()->getParameter('app.root'), + \Drupal::getContainer()->getParameter('site.path'), array_keys(\Drupal::service('module_handler')->getModuleList()), \Drupal::service('keyvalue')->get('deploy_hook') ) extends UpdateRegistry {