If you go to admin/structure/menu and click the 'add link' button next to one of the menus, you get taken to admin/structure/menu/add?menu=main which is the form for adding a new menu rather than a link.

Comments

tim.plunkett’s picture

Issue tags: +Needs tests
kim.pepper’s picture

Status: Active » Needs review
Issue tags: -Needs tests
StatusFileSize
new1.61 MB

I think this assertion shows the link is incorrect. No idea how to fix it though!

Status: Needs review » Needs work

The last submitted patch, 2: 2312925-menu-link-bug-test-only.patch, failed testing.

kim.pepper’s picture

StatusFileSize
new712 bytes

Hmm. Accidentally diffed against the 8.x branch instead of the 8.0.x branch.

kim.pepper’s picture

Status: Needs work » Needs review
kim.pepper’s picture

+++ b/core/modules/menu_ui/src/Tests/MenuTest.php
@@ -249,6 +249,10 @@ function doMenuTests() {
+    $this->assertLinkByHref('admin/structure/menu/manage/' . $menu_name . '/add', "The add menu link button url is correct");

I think the path needs to have a forward slash. Also, not sure if there should be query string params (destination?)

Status: Needs review » Needs work

The last submitted patch, 4: 2312925-menu-link-bug-2-test-only.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new2.18 KB

I think this assertion shows the link is incorrect. No idea how to fix it though!

We can collaborate on that.

Status: Needs review » Needs work

The last submitted patch, 8: menu_link_add-2312925-8.patch, failed testing.

olli’s picture

Status: Needs work » Needs review
StatusFileSize
new2.18 KB
new722 bytes

Fixed the test.

tim.plunkett’s picture

+++ b/core/modules/menu_ui/menu_ui.module
@@ -76,6 +76,9 @@ function menu_ui_entity_type_build(array &$entity_types) {
+  if (isset($entity_types['menu_link_content'])) {

+++ b/core/modules/menu_ui/src/MenuListBuilder.php
@@ -51,10 +51,12 @@ public function getDefaultOperations(EntityInterface $entity) {
+      if ($this->moduleHandler()->moduleExists('menu_link_content')) {

menu_ui.info.yml lists a dependency on menu_link_content, so no need for the checks.

olli’s picture

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

I think this looks good.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

@tim.plunkett Me too :)

Committed e3833d0 and pushed to 8.x. Thanks!

  • alexpott committed e3833d0 on 8.0.x
    Issue #2312925 by olli, kim.pepper, dawehner: Fixed 'Add Link' button...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.