As roles in Drupal are not a one to one based on user, the current logic for selecting which menu to show is a bit too static to my current requirement.
I have added the ability to sort the list of menu to role, this allows for 1 user to have multiple roles assigned to it and the menu with the highest weight gets used.

| Comment | File | Size | Author |
|---|---|---|---|
| #6 | interdiff5-2.txt | 5.09 KB | vitalie |
| #5 | allow_ordering_of_the-2441283-5.patch | 7.23 KB | vitalie |
| #2 | allow_ordering_of_the-2441283-2.patch | 6.1 KB | lslinnet |
| Screen Shot 2015-02-26 at 10.41.42.png | 29 KB | lslinnet | |
| admin_menu_source_role_list_ordering.patch | 6.09 KB | lslinnet |
Comments
Comment #1
lslinnet commentedSeems in my haste I based the patch on the 1.0 release and not HEAD + and based the patch on the wrong directory structure.
New patch for fixing it is incoming.
Comment #2
lslinnet commentedNow the patch should be correct, and applied against the HEAD instead of 1.0 release.
Comment #3
lslinnet commentedComment #4
shadcn commentedThanks for the patch. I'm getting the following errors on testing:
Comment #5
vitalie commentedthanks @lslinnet. I like the idea. The patch in #2 was not respecting the weights when building the settings form. Here's another that builds on it. It:
* should fix the notice reported in #4
* limits the available roles in the setting form to only those that have 'access administration menu' permission
* sorts the settings by weight on form save, instead of admin_menu_source_admin_menu_output_alter
* if new roles are added (that do not yet have a weight for example), they are assumed to have lower priority (so bigger weight)
Comment #6
vitalie commentedHere's also an interdiff between patch in #5 and it's source in #2.
Comment #7
dafederThis patch is a great addition. Working fine for me.
Comment #8
shadcn commentedThanks for reviewing. I'll commit.
Comment #10
shadcn commentedPatch committed. Thanks everyone :)