Setting Max bundle items can result in hiding menus that should not be hidden

Created on 5 October 2022, about 2 years ago
Updated 10 July 2024, 5 months ago

Problem/Motivation

It is possible to limit the amount of items in the admin menu with the "Maximum number of bundle sub-menus to display". This can be a problem with links to config entities, like menus. The limiting is done before the access check, so this could lead to less items in the menu than expected.
Drupal core has only one permission for editing menus, so that is not an issue, but when using a module like Menu admin per menu or implementing custom permissions per menu, this could lead to unexpected results.

Steps to reproduce

  • Install Menu admin per menu
  • Create some menus, let say 10
  • Give access to the last 5 (alphabetically) menus for a user, but do not give the adminiser menu permisison
  • Set the number of bundle items to show to 5 items
  • Log in as that user and see that NOT all 5 menus are shown under Structure > Menus

Proposed resolution

Do an access check on the Menu entities before limiting the amount shown.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.1

Component

Code

Created by

🇳🇱Netherlands pgrond

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