Empty 'Parent link' if user has no permission to add new menu links

Created on 7 March 2022, almost 3 years ago
Updated 13 October 2024, 2 months ago

Problem/Motivation

Hi !

I have noticed that if a user:

  1. has the permission edit links in main menu
  2. does not have the permission add new links to main menu

Then the select box Parent link at admin/structure/menu/item/%/edit (i.e. when editing a menu item) is empty.

This prevents the user from editing the menu item without affecting its parent link.

Here is a screenshot for clarity:

Proposed resolution

How about not altering this field, and let users with the edit links in main menu permission move the menu item in the hierarchy ? That looks more like an menu link update rather than a menu link creation.

Maybe the intent is to prevent users from moving menu items from one menu (say, the footer menu) to another (say, the main menu) in which case the operation may indeed be considered a creation rather than an update. That being said, 🐛 When adding a new menu link, restrict the available parents to the current menu Fixed will remove the ability for users to move a menu item from one menu to another.

Attached is a proposed patch.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇨🇦Canada fengtan Montreal, Canada

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024