Problem/Motivation

We were discussing #3387665: Warn user when entity delete will cause menu item re-parenting in today's usability meeting #3420206: Drupal Usability Meeting 2024-02-16. The latter issue will have a link to a recording of the meeting. For the record the attendees of the meeting were @AaronMcHale, @benjifisher, @rkoller, @simohell, and @worldlinemine

While testing the former issue on a site with the Umami install profile we've noticed, while following along the steps to reproduce on the main navigation menu (/admin/structure/menu/manage/main), that one of the options for the Article menu is visually broken and dysfunctional:

menu item options edit delete add child with delete without styling

Turns out in Umami the Article menu item is build by a dedicated View. The broken styling and behavior is reproducible with any new View you create. The functionality of having operational options available for a menu item was introduced with #2684577: Entity operations for menu links are hardcoded in edit menu form. I've spun up a fresh install of Drupal 10.1.0 with the standard profile and went through the steps to reproduce listed next and the problem is available there as well.

Steps to reproduce

1. Add a new view (/admin/structure/views/add
2. Add a name
3. Select to show Content of type Article
4. Check Create a page and check Create a menu link adding it to <Main navigation>
5. Save
6. Go to /admin/structure/menu/manage/main
7. Check the options of the newly created and added menu item

Proposed resolution

Since the option to delete a menu item that is created by a View is unavailable as an action and therefore disabled, it would be probably the best choice to apply progressive disclosure and simply hide the delete option.

I'll open another follow up issue and link it afterwards to this issue. We've discussed also to label what type of menu item you have in front of you. So in case of a menu item that is created by a view you as the user would see that this is a Views based menu item, and that this is the reason why I am unable to for example not to delete that menu item. At the moment all menu items are uniform, their category is only implicitly communicated by the number and type of operation options.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3421998

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rkoller created an issue. See original summary.

rkoller’s picture

Issue summary: View changes
rkoller’s picture

Issue summary: View changes
benjifisher’s picture

Maybe this should be a separate issue, but today I noticed that I cannot set a menu item to Expanded if it is created by Views.

pierreemmanuel made their first commit to this issue’s fork.

pierreemmanuel’s picture

StatusFileSize
new54.27 KB

Hello,

I reproduce the issue with a new Drupal v10.3.11, adding a link to the content blockview in the Main menu.
delete visible

Regards

pierreemmanuel’s picture

StatusFileSize
new478 bytes

Please find a patch based on css to hide the button if no link is provided.
3421998-10.5.x-7.patch

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.