Menu Depth > 1 not shown for users other than ID 1

Created on 10 July 2018, almost 6 years ago
Updated 27 October 2023, 8 months ago

UPDATE: Problem caused by other module. Not a toolbar menu bug.

Problem

Nested menus do not work for users other than user ID 1. The top level is rendered, but sub levels are not visible.

Steps to reproduce

  1. Create a new menu
  2. Add top level menu entry in that menu, e.g. Google.com (Link https://www.google.com)
  3. Add top sub level menu entry, e.g. Google.de (Link https://www.google.com, parent as above)
  4. Result: Google.com is visible, Google.de is not visible

In the JS console I do see an HTTP 403-forbidden error for path /toolbar/subtrees/undefined?_wrapper_format=drupal_ajax. I can certainly exclude any misconfiguration regarding roles/permissions: The menu itself is visible for the user, the top level entry is visible, but sub entries are invisible even for external URLs or anonymously-allowed routes.

I tried adding sub entries through menu UI and by my_module.links.yml, same error in both cases.
Adding/removing the "expanded" checkbox in menu UI does not change anything.
Adding setMaxDepth(4) in toolbar_menu_prerender_toolbar_tray as suggested in issue #2945706 β†’ did not fix the problem.

πŸ› Bug report
Status

Closed: cannot reproduce

Version

2.1

Component

Code

Created by

πŸ‡¦πŸ‡ΉAustria hudri Austria

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.

  • πŸ‡ΊπŸ‡ΈUnited States RichardDavies Portland, Oregon

    @hudri Thank you for figuring this out and providing a fix. We were experiencing the exact same error and I couldn't figure out why until I found this bug report and discovered we were also unsetting the administration menu just like you were in order to hide it from certain users. Your fix works perfectly!

Production build 0.69.0 2024