Skip to content

Commit d124723

Browse files
authored
Avoid DI for PermissionHandler in pm:install (#6155)
1 parent 038a783 commit d124723

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Commands/pm/PmCommands.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Consolidation\AnnotatedCommand\CommandData;
88
use Consolidation\AnnotatedCommand\Hooks\HookManager;
99
use Consolidation\OutputFormatters\StructuredData\RowsOfFields;
10+
use Drupal;
1011
use Drupal\Core\Config\ConfigFactoryInterface;
1112
use Drupal\Core\Extension\Extension;
1213
use Drupal\Core\Extension\MissingDependencyException;
@@ -407,7 +408,8 @@ protected function getModuleLinks(Extension $module): array
407408
}
408409

409410
// Generate link for module's permissions page.
410-
if ($module->status && $this->getPermissionHandler()->moduleProvidesPermissions($module->getName())) {
411+
// Avoid DI for PermissionHandler until we understand better at https://github.com/drush-ops/drush/issues/6154.
412+
if ($module->status && Drupal::service(PermissionHandlerInterface::class)->moduleProvidesPermissions($module->getName())) {
411413
$links[] = Link::fromTextAndUrl(dt('Permissions'), Url::fromRoute('user.admin_permissions.module', ['modules' => $module->getName()]));
412414
}
413415

0 commit comments

Comments
 (0)