Commit e3833d0f authored by alexpott's avatar alexpott
Browse files

Issue #2312925 by olli, kim.pepper, dawehner: Fixed 'Add Link' button adds a new menu instead.

parent 54a49d50
......@@ -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');
}
......
......@@ -54,7 +54,7 @@ public function getDefaultOperations(EntityInterface $entity) {
$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');
......
......@@ -249,6 +249,10 @@ function doMenuTests() {
),
));
// 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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment