diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index f216202..7fd9ad7 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -86,17 +86,17 @@ function menu_menu() { ); $items['admin/structure/menu/manage/%menu'] = array( 'title' => 'Edit menu', + 'title callback' => 'menu_page_label', + 'title arguments' => array(4), 'route_name' => 'menu_edit_menu', ); $items['admin/structure/menu/manage/%menu/add'] = array( - 'title' => 'Add menu link', + 'title' => 'Add link', 'type' => MENU_LOCAL_ACTION, 'route_name' => 'menu_link_add', ); $items['admin/structure/menu/manage/%menu/edit'] = array( 'title' => 'Edit menu', - 'title callback' => 'entity_page_label', - 'title arguments' => array(4), 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10, 'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE, @@ -121,6 +121,22 @@ function menu_menu() { } /** + * Title callback: Returns the label of the menu. + * + * @todo http://drupal.org/node/1981644 + * + * @param int $menu_id + * The entity ID of the menu. + * + * @return string + * The menu's label. + */ +function menu_page_label($menu_id) { + $menu = entity_load('menu', $menu_id); + return $menu->label(); +} + +/** * Implements hook_entity_info_alter(). */ function menu_entity_info_alter(&$entity_info) { diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php index 77dab9e..c4c3478 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php @@ -120,7 +120,7 @@ function testBreadCrumbs() { $trail += array( 'admin/structure/menu/manage/tools' => t('Tools'), ); - $this->assertBreadcrumb("admin/structure/menu/item/$mlid_node_add", $trail); + $this->assertBreadcrumb("admin/structure/menu/item/$mlid_node_add/edit", $trail); $this->assertBreadcrumb('admin/structure/menu/manage/tools/add', $trail); // Verify Node administration breadcrumbs. @@ -140,7 +140,7 @@ function testBreadCrumbs() { ); $this->assertBreadcrumb("admin/structure/types/manage/$type/display/teaser", $trail_teaser); $this->assertBreadcrumb("admin/structure/types/manage/$type/comment/fields", $trail); - $this->assertBreadcrumb("admin/structure/Gtypes/manage/$type/comment/display", $trail); + $this->assertBreadcrumb("admin/structure/types/manage/$type/comment/display", $trail); $this->assertBreadcrumb("admin/structure/types/manage/$type/delete", $trail); $trail += array( "admin/structure/types/manage/$type/fields" => t('Manage fields'), @@ -467,7 +467,7 @@ function testBreadCrumbs() { $edit = array( 'parent' => "$menu:{$link_user['mlid']}", ); - $this->drupalPost("admin/structure/menu/item/{$link_admin_user['mlid']}", $edit, t('Save')); + $this->drupalPost("admin/structure/menu/item/{$link_admin_user['mlid']}/edit", $edit, t('Save')); $this->drupalLogout(); $trail = $home;