diff --git a/core/modules/system/src/Form/ModulesListForm.php b/core/modules/system/src/Form/ModulesListForm.php index d38749400b565d13c9c8285512a87dd456b6ba41..57122be5e7b663a06f454a454d0cc9eb6fdc18f1 100644 --- a/core/modules/system/src/Form/ModulesListForm.php +++ b/core/modules/system/src/Form/ModulesListForm.php @@ -259,9 +259,9 @@ protected function buildRow(array $modules, Extension $module, $distribution) { if ($this->moduleHandler->moduleExists('help') && $module->status && in_array($module->getName(), $this->moduleHandler->getImplementations('help'))) { $row['links']['help'] = [ '#type' => 'link', - '#title' => $this->t('Help'), + '#title' => $this->t('Help <span class="visually-hidden">for @module</span>', ['@module' => $module->info['name']]), '#url' => Url::fromRoute('help.page', ['name' => $module->getName()]), - '#options' => ['attributes' => ['class' => ['module-link', 'module-link-help'], 'title' => $this->t('Help')]], + '#options' => ['attributes' => ['class' => ['module-link', 'module-link-help']]], ]; } @@ -269,9 +269,9 @@ protected function buildRow(array $modules, Extension $module, $distribution) { if ($module->status && $this->currentUser->hasPermission('administer permissions') && $this->permissionHandler->moduleProvidesPermissions($module->getName())) { $row['links']['permissions'] = [ '#type' => 'link', - '#title' => $this->t('Permissions'), + '#title' => $this->t('Permissions <span class="visually-hidden">for @module</span>', ['@module' => $module->info['name']]), '#url' => Url::fromRoute('user.admin_permissions.module', ['modules' => $module->getName()]), - '#options' => ['attributes' => ['class' => ['module-link', 'module-link-permissions'], 'title' => $this->t('Configure permissions')]], + '#options' => ['attributes' => ['class' => ['module-link', 'module-link-permissions']]], ]; } @@ -281,7 +281,7 @@ protected function buildRow(array $modules, Extension $module, $distribution) { if ($this->accessManager->checkNamedRoute($module->info['configure'], $route_parameters, $this->currentUser)) { $row['links']['configure'] = [ '#type' => 'link', - '#title' => $this->t('Configure <span class="visually-hidden">the @module module</span>', ['@module' => $module->info['name']]), + '#title' => $this->t('Configure <span class="visually-hidden">@module</span>', ['@module' => $module->info['name']]), '#url' => Url::fromRoute($module->info['configure'], $route_parameters), '#options' => [ 'attributes' => [ diff --git a/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php b/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php index 3d0245a89a9c8602c8eb2c79e6474f41c7d72efb..af41b0de5d6df900bbd90c784146b5538ff5cd84 100644 --- a/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php +++ b/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php @@ -41,13 +41,13 @@ public function testModuleListForm() { $this->drupalGet('admin/modules'); // Check that system_test's configure link was rendered correctly. - $this->assertSession()->elementExists('xpath', "//a[contains(@href, '/system-test/configure/bar') and text()='Configure ']/span[contains(@class, 'visually-hidden') and text()='the System test module']"); + $this->assertSession()->elementExists('xpath', "//a[contains(@href, '/system-test/configure/bar') and text()='Configure ']/span[contains(@class, 'visually-hidden') and text()='System test']"); // Check that system_test's permissions link was rendered correctly. - $this->assertSession()->elementExists('xpath', "//a[contains(@href, '/admin/people/permissions/module/system_test') and @title='Configure permissions']"); + $this->assertSession()->elementExists('xpath', "//a[contains(@href, '/admin/people/permissions/module/system_test') and text()='Permissions ']/span[contains(@class, 'visually-hidden') and text()='for System test']"); // Check that system_test's help link was rendered correctly. - $this->assertSession()->elementExists('xpath', "//a[contains(@href, '/admin/help/system_test') and @title='Help']"); + $this->assertSession()->elementExists('xpath', "//a[contains(@href, '/admin/help/system_test') and text()='Help ']/span[contains(@class, 'visually-hidden') and text()='for System test']"); // Ensure that the Database Logging module's machine name is printed. This // module is used because its machine name is different than its human