Problem/Motivation

This is a D7 backport of #3110371: When adding a new menu link, restrict the available parents to the current menu. We probably want to backport this significant usability improvement.

The patch itself is changing only the options in the parent field when creating a new menu item in a specific menu. No other use-cases are affected.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3384397-2.patch3.67 KBpoker10

Comments

poker10 created an issue. See original summary.

poker10’s picture

Status: Active » Needs review
StatusFileSize
new3.67 KB

Uploading a backport of the D10 patch. I think this should be pretty safe, because when you click "add link" in a specific menu, you want to add menu link to that specific menu, so you do not need other menus displayed. Other use-cases (like editing the menu item, or using vertical tabs in node to set a menu item) are not affected by the patch.

I had to duplicate the assertNoOption() and assertOption() functions in tests, which is not ideal. But not sure if we are going to refactor the original ones (as proposed in the @todo) until the D7 EOL, so this is probably not a big issue and should not block this issue.

poker10’s picture

Issue tags: +Pending Drupal 7 commit

Adding a tag for the review from another D7 maintainer before commit.

fabianx’s picture

Status: Needs review » Reviewed & tested by the community

RTBC! Great fix!

  • mcdruid committed c3148e17 on 7.x
    Issue #3384397 by poker10, Fabianx: [D7] When adding a new menu link,...
mcdruid’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Pending Drupal 7 commit

Thanks!

poker10’s picture

I have drafted a CR here: https://www.drupal.org/node/3406314 (it is similar to the D10 CR)

Status: Fixed » Closed (fixed)

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