diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 3ba3b5d..e6c070e 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -1723,6 +1723,11 @@ function theme_menu_local_task($variables) { 'localized_options' => array(), ); $link_text = $link['title']; + if (!empty($link['description'])) { + $link['localized_options']['attributes']['title'] = check_plain( + $link['description'] + ); + } if (!empty($variables['element']['#active'])) { // Add text to indicate active tab for non-visual users. diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php index 9366aef..7f7088a 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php @@ -112,6 +112,10 @@ function testLocalTasks() { )); $this->assertText('Show it'); $this->assertText('Advanced settings'); + + // Verify the title attribute get's set correctly on a local task. + $this->drupalGet('menu-test/tasks/tasks/edit'); + $this->assertRaw('Local task description', "Local task title attribute get's set correctly."); } /** diff --git a/core/modules/system/tests/modules/menu_test/menu_test.module b/core/modules/system/tests/modules/menu_test/menu_test.module index 833d497..845dee4 100644 --- a/core/modules/system/tests/modules/menu_test/menu_test.module +++ b/core/modules/system/tests/modules/menu_test/menu_test.module @@ -262,6 +262,7 @@ function menu_test_menu() { ) + $base; $items['menu-test/tasks/tasks/edit'] = array( 'title' => 'Edit', + 'description' => 'Local task description', 'type' => MENU_LOCAL_TASK, ) + $base; $items['menu-test/tasks/tasks/settings'] = array(