From d124723dacb4208ccb875b7114722e420fccf06d Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Sun, 10 Nov 2024 15:02:03 -0500 Subject: [PATCH] Avoid DI for PermissionHandler in pm:install (#6155) --- src/Commands/pm/PmCommands.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Commands/pm/PmCommands.php b/src/Commands/pm/PmCommands.php index a00af96b83..87ea241199 100644 --- a/src/Commands/pm/PmCommands.php +++ b/src/Commands/pm/PmCommands.php @@ -7,6 +7,7 @@ use Consolidation\AnnotatedCommand\CommandData; use Consolidation\AnnotatedCommand\Hooks\HookManager; use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Drupal; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Extension\Extension; use Drupal\Core\Extension\MissingDependencyException; @@ -407,7 +408,8 @@ protected function getModuleLinks(Extension $module): array } // Generate link for module's permissions page. - if ($module->status && $this->getPermissionHandler()->moduleProvidesPermissions($module->getName())) { + // Avoid DI for PermissionHandler until we understand better at https://github.com/drush-ops/drush/issues/6154. + if ($module->status && Drupal::service(PermissionHandlerInterface::class)->moduleProvidesPermissions($module->getName())) { $links[] = Link::fromTextAndUrl(dt('Permissions'), Url::fromRoute('user.admin_permissions.module', ['modules' => $module->getName()])); }