Skip to content

Commit

Permalink
Avoid DI for PermissionHandler in pm:install (#6155)
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman authored Nov 10, 2024
1 parent 038a783 commit d124723
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Commands/pm/PmCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()]));
}

Expand Down

0 comments on commit d124723

Please sign in to comment.