From c680d33dc3f25386dc97c2e822de85a401989f1c Mon Sep 17 00:00:00 2001 From: webchick Date: Wed, 27 May 2015 23:18:27 -0700 Subject: [PATCH] Issue #2495657 by alexpott, jhodgdon: Admin links are missing from a module's help page --- core/modules/help/src/Controller/HelpController.php | 3 ++- core/modules/help/src/Tests/HelpTest.php | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/core/modules/help/src/Controller/HelpController.php b/core/modules/help/src/Controller/HelpController.php index 3561fde58e8..ab969d8c137 100644 --- a/core/modules/help/src/Controller/HelpController.php +++ b/core/modules/help/src/Controller/HelpController.php @@ -137,7 +137,8 @@ class HelpController extends ControllerBase { $link['title'] = $task['title']; $links[] = $link; } - $build['links']['#links'] = array( + $build['links'] = array( + '#theme' => 'links__help', '#heading' => array( 'level' => 'h3', 'text' => $this->t('@module administration pages', array('@module' => $module_name)), diff --git a/core/modules/help/src/Tests/HelpTest.php b/core/modules/help/src/Tests/HelpTest.php index 0ea0d426a35..66626a58262 100644 --- a/core/modules/help/src/Tests/HelpTest.php +++ b/core/modules/help/src/Tests/HelpTest.php @@ -50,8 +50,9 @@ class HelpTest extends WebTestBase { * Logs in users, creates dblog events, and tests dblog functionality. */ public function testHelp() { - // Login the admin user. - $this->drupalLogin($this->adminUser); + // Login the root user to ensure as many admin links appear as possible on + // the module overview pages. + $this->drupalLogin($this->rootUser); $this->verifyHelp(); // Login the regular user. @@ -95,6 +96,13 @@ class HelpTest extends WebTestBase { if ($response == 200) { $this->assertTitle($name . ' | Drupal', format_string('%module title was displayed', array('%module' => $module))); $this->assertRaw('

' . t($name) . '

', format_string('%module heading was displayed', array('%module' => $module))); + $admin_tasks = system_get_module_admin_tasks($module, system_get_info('module', $module)); + if (!empty($admin_tasks)) { + $this->assertText(t('@module administration pages', array('@module' => $name))); + } + foreach ($admin_tasks as $task) { + $this->assertLink($task['title']); + } } } }