Problem/Motivation
If a user/role (other than uid 1) don't have the permission 'show administration menu in the toolbar', nested menus do not work.
The top level is rendered, but sub levels are not visible.
@see: https://www.drupal.org/project/toolbar_menu/issues/2949053#comment-12681327
Steps to reproduce
- Install toolbar_menu and toolbar_menu_clean modules
- Create a nested menu with toolbar_menu to replace "administration menu" for a specific role
- Give the permission to see your new menu (toolbar_menu) and remove permission 'show administration menu in the toolbar' (toolbar_menu_clean)
Proposed resolution
As suggested in this issue for the toolbar_menu module, change the line 36 in toolbar_menu_clean.module file :
unset($items['administration'])
by
$items['administration']['#wrapper_attributes']['class'] = 'visually-hidden';
Merge toolbar_menu and toolbar_menu_clean ?
I discover the toolbar_menu_clean project from this issue on toolbar_menu project. Clearly, toolbar_menu_clean is an important complement to toolbar_menu to provide a good "editor" or "webmaster" experience ! IMHO, 2 project are related and thing will be easier if it was only one project (maybe with a submodule).
| Comment | File | Size | Author |
|---|
Issue fork toolbar_menu_clean-3230506
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
Comment #3
mitsuko commentedComment #4
mitsuko commentedComment #5
anruetherThanks for figuring this out! This solves my issue from #3273601: Dropdown not working for toolbar_menu menus
Comment #6
anruetherComment #7
anruetherUploading as patch to be used in projects.
Comment #8
mitsuko commentedHi anruether,
Thank you for your feedback.
For information, you can get the patch by clicking on "plain diff" in the Issue Fork frame (it's a little bit too discreet).
Comment #9
anruether@Mitsuko Yes, but the MR can change. When using a patch in a project I want it to be stable. However, we can hide the patch so it is clear that work is done in the MR.
Comment #11
zipme_hkt commentedComment #12
zipme_hkt commented