summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-08-04 12:07:26 +0100
committerAlex Pott2014-08-04 12:07:26 +0100
commite3833d0f4928e1193ebd3f3b9aa6f462541d43b3 (patch)
treec20153df74640161fc78f5f67ba772647ff47402
parent54a49d507c8a2a207b401a23dcf065d841562889 (diff)
Issue #2312925 by olli, kim.pepper, dawehner: Fixed 'Add Link' button adds a new menu instead.
-rw-r--r--core/modules/menu_ui/menu_ui.module3
-rw-r--r--core/modules/menu_ui/src/MenuListBuilder.php2
-rw-r--r--core/modules/menu_ui/src/Tests/MenuTest.php4
3 files changed, 7 insertions, 2 deletions
diff --git a/core/modules/menu_ui/menu_ui.module b/core/modules/menu_ui/menu_ui.module
index 8dbb4e2..efe5d0f 100644
--- a/core/modules/menu_ui/menu_ui.module
+++ b/core/modules/menu_ui/menu_ui.module
@@ -75,7 +75,8 @@ function menu_ui_entity_type_build(array &$entity_types) {
->setListBuilderClass('Drupal\menu_ui\MenuListBuilder')
->setLinkTemplate('add-form', 'menu_ui.menu_add')
->setLinkTemplate('delete-form', 'menu_ui.delete_menu')
- ->setLinkTemplate('edit-form', 'menu_ui.menu_edit');
+ ->setLinkTemplate('edit-form', 'menu_ui.menu_edit')
+ ->setLinkTemplate('add-link-form', 'menu_link_content.link_add');
}
diff --git a/core/modules/menu_ui/src/MenuListBuilder.php b/core/modules/menu_ui/src/MenuListBuilder.php
index 0c6615d..4fdb298 100644
--- a/core/modules/menu_ui/src/MenuListBuilder.php
+++ b/core/modules/menu_ui/src/MenuListBuilder.php
@@ -54,7 +54,7 @@ class MenuListBuilder extends ConfigEntityListBuilder {
$operations['add'] = array(
'title' => t('Add link'),
'weight' => 20,
- ) + $entity->urlInfo('add-form')->toArray();
+ ) + $entity->urlInfo('add-link-form')->toArray();
}
if (isset($operations['delete'])) {
$operations['delete']['title'] = t('Delete menu');
diff --git a/core/modules/menu_ui/src/Tests/MenuTest.php b/core/modules/menu_ui/src/Tests/MenuTest.php
index ce7fd57..cf92af2 100644
--- a/core/modules/menu_ui/src/Tests/MenuTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuTest.php
@@ -249,6 +249,10 @@ class MenuTest extends MenuWebTestBase {
),
));
+ // Verify add link button.
+ $this->drupalGet('admin/structure/menu');
+ $this->assertLinkByHref('admin/structure/menu/manage/' . $menu_name . '/add', 0, "The add menu link button url is correct");
+
// Add menu links.
$item1 = $this->addMenuLink('', 'node/' . $node1->id(), $menu_name, TRUE);
$item2 = $this->addMenuLink($item1->getPluginId(), 'node/' . $node2->id(), $menu_name, FALSE);