Skip to content

Commit fb6498d

Browse files
authored
Fixes deprecations of renderPlain() & getName() (#1136)
1 parent e9acb4a commit fb6498d

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

modules/apigee_edge_teams/apigee_edge_teams.services.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ services:
6565

6666
apigee_edge_teams.team_permissions:
6767
class: Drupal\apigee_edge_teams\TeamPermissionHandler
68-
arguments: ['@module_handler', '@class_resolver', '@apigee_edge_teams.team_membership_manager', '@entity_type.manager']
68+
arguments: ['@module_handler', '@class_resolver', '@apigee_edge_teams.team_membership_manager', '@entity_type.manager', '@extension.list.module']
6969
calls:
7070
- [setStringTranslation, ['@string_translation']]
7171

modules/apigee_edge_teams/src/TeamPermissionHandler.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use Drupal\Core\Discovery\YamlDiscovery;
2525
use Drupal\Core\Entity\EntityTypeManagerInterface;
2626
use Drupal\Core\Extension\ModuleHandlerInterface;
27+
use Drupal\Core\Extension\ModuleExtensionList;
2728
use Drupal\Core\Session\AccountInterface;
2829
use Drupal\Core\StringTranslation\StringTranslationTrait;
2930
use Drupal\apigee_edge_teams\Entity\TeamInterface;
@@ -112,6 +113,13 @@ final class TeamPermissionHandler implements TeamPermissionHandlerInterface {
112113
*/
113114
private $entityTypeManager;
114115

116+
/**
117+
* The module extension list.
118+
*
119+
* @var \Drupal\Core\Extension\ModuleExtensionList
120+
*/
121+
private $moduleExtensionList;
122+
115123
/**
116124
* TeamPermissionHandler constructor.
117125
*
@@ -123,12 +131,15 @@ final class TeamPermissionHandler implements TeamPermissionHandlerInterface {
123131
* The team membership manager service.
124132
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
125133
* The entity type manager.
134+
* @param \Drupal\Core\Extension\ModuleExtensionList $module_extension_list
135+
* The module extension list.
126136
*/
127-
public function __construct(ModuleHandlerInterface $module_handler, ClassResolverInterface $class_resolver, TeamMembershipManagerInterface $team_membership_manager, EntityTypeManagerInterface $entity_type_manager) {
137+
public function __construct(ModuleHandlerInterface $module_handler, ClassResolverInterface $class_resolver, TeamMembershipManagerInterface $team_membership_manager, EntityTypeManagerInterface $entity_type_manager, ModuleExtensionList $module_extension_list) {
128138
$this->moduleHandler = $module_handler;
129139
$this->classResolver = $class_resolver;
130140
$this->teamMembershipManager = $team_membership_manager;
131141
$this->entityTypeManager = $entity_type_manager;
142+
$this->moduleExtensionList = $module_extension_list;
132143
}
133144

134145
/**
@@ -299,7 +310,7 @@ protected function sortPermissions(array $all_permissions = []) {
299310
protected function getModuleNames(): array {
300311
$modules = [];
301312
foreach (array_keys($this->moduleHandler->getModuleList()) as $module) {
302-
$modules[$module] = $this->moduleHandler->getName($module);
313+
$modules[$module] = $this->moduleExtensionList->getName($module);
303314
}
304315
asort($modules);
305316
return $modules;

src/Entity/ListBuilder/AppListBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ protected function buildWarningRow(AppInterface $app, array &$rows) {
290290
$url = Url::fromUserInput($this->requestStack->getCurrentRequest()->getRequestUri(), $link_options);
291291
$link = Link::fromTextAndUrl($this->t('<span class="ui-icon-triangle-1-e ui-icon"></span><span class="text">Show details</span>'), $url);
292292
$build['warning-toggle'] = $link->toRenderable();
293-
$rows[$info_row_css_id]['data']['status']['data'] = $this->renderer->renderPlain($build);
293+
$rows[$info_row_css_id]['data']['status']['data'] = $this->renderer->renderInIsolation($build);
294294
$row['data']['info'] = [
295295
'colspan' => count($this->buildHeader()),
296296
];

0 commit comments

Comments
 (0)