summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/menu.inc11
-rw-r--r--modules/help/help.test7
2 files changed, 12 insertions, 6 deletions
diff --git a/includes/menu.inc b/includes/menu.inc
index 38168bcc7..361b8dc19 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -1493,11 +1493,12 @@ function menu_get_active_help() {
// Lookup help for this path.
if ($help = $function($router_path, $arg)) {
$output .= $help . "\n";
- }
- // Add "more help" link on admin pages if the module provides a
- // standalone help page.
- if ($arg[0] == "admin" && user_access('access administration pages') && module_exists('help') && $function('admin/help#' . $arg[2], $empty_arg) && $help) {
- $output .= theme("more_help_link", array('url' => url('admin/help/' . $arg[2])));
+
+ // Add "more help" link on admin pages if the module provides a
+ // standalone help page.
+ if ($arg[0] == "admin" && user_access('access administration pages') && module_exists('help') && $function('admin/help#' . $module, $empty_arg)) {
+ $output .= theme("more_help_link", array('url' => url('admin/help/' . $module)));
+ }
}
}
return $output;
diff --git a/modules/help/help.test b/modules/help/help.test
index 4cc73c181..8e2fed968 100644
--- a/modules/help/help.test
+++ b/modules/help/help.test
@@ -22,7 +22,7 @@ class HelpTestCase extends DrupalWebTestCase {
$this->getModuleList();
// Create users.
- $this->big_user = $this->drupalCreateUser(array('access administration pages'));
+ $this->big_user = $this->drupalCreateUser(array('access administration pages', 'administer permissions'));
$this->any_user = $this->drupalCreateUser(array());
}
@@ -53,6 +53,11 @@ class HelpTestCase extends DrupalWebTestCase {
foreach ($this->modules as $module => $name) {
$this->assertLink($name, 0, t('Link properly added to @name (admin/help/@module)', array('@module' => $module, '@name' => $name)));
}
+
+ // Verify that the "More help" links generated by menu.inc work properly.
+ // Test on an out-of-the-way page.
+ $this->drupalGet('admin/config/people/roles');
+ $this->assertRaw(theme("more_help_link", array('url' => url('admin/help/user'))), t('"More help" link is functional.'));
}
/**