diff --git a/core/includes/menu.inc b/core/includes/menu.inc index bf94563..a4f5e77 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -2202,6 +2202,13 @@ function menu_contextual_links($module, $parent_path, $args) { if (!$item['access']) { continue; } + + // If this item is a default local task, rewrite the href to link to its + // parent item. + if ($item['type'] == MENU_DEFAULT_LOCAL_TASK) { + $item['href'] = $item['tab_parent_href']; + } + // All contextual links are keyed by the actual "task" path argument, // prefixed with the name of the implementing module. $links[$module . '-' . $key] = $item; diff --git a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php index d88894d..73e493a 100644 --- a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php @@ -174,7 +174,7 @@ public function testBlockContextualLinks() { )); $this->assertResponse(200); $json = drupal_json_decode($response); - $this->assertIdentical($json[$id], ''); + $this->assertIdentical($json[$id], ''); } } diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php index 106ac64..a5c5456 100644 --- a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php +++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php @@ -329,7 +329,7 @@ public function testBlockContextualLinks() { )); $this->assertResponse(200); $json = drupal_json_decode($response); - $this->assertIdentical($json[$id], ''); + $this->assertIdentical($json[$id], ''); } /** diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module index bd73fa8..21fdabe 100644 --- a/core/modules/views_ui/views_ui.module +++ b/core/modules/views_ui/views_ui.module @@ -349,7 +349,7 @@ function views_ui_contextual_links_view_alter(&$element, $items) { // screen. elseif (!empty($element['#links']['views-ui-edit'])) { $display_id = $element['#contextual_links']['views_ui'][2]['display_id']; - $element['#links']['views-ui-edit']['href'] .= '/' . $display_id; + $element['#links']['views-ui-edit']['href'] .= '/edit/' . $display_id; } }