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.

Show list of roles that can be ordered.

Comments

lslinnet’s picture

Status: Needs review » Needs work

Seems 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.

lslinnet’s picture

StatusFileSize
new6.1 KB

Now the patch should be correct, and applied against the HEAD instead of 1.0 release.

lslinnet’s picture

Status: Needs work » Needs review
shadcn’s picture

Status: Needs review » Needs work

Thanks for the patch. I'm getting the following errors on testing:

Notice: Undefined offset: 1 in admin_menu_source_settings() (line 43 of /home/s2ae35eae2416118/www/sites/default/modules/admin_menu_source/admin_menu_source.inc).

vitalie’s picture

StatusFileSize
new7.23 KB

thanks @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)

vitalie’s picture

StatusFileSize
new5.09 KB

Here's also an interdiff between patch in #5 and it's source in #2.

dafeder’s picture

Status: Needs work » Reviewed & tested by the community

This patch is a great addition. Working fine for me.

shadcn’s picture

Assigned: lslinnet » shadcn

Thanks for reviewing. I'll commit.

  • arshadcn committed d1d85c3 on 7.x-1.x authored by vitalie
    Issue #2441283 by lslinnet, vitalie: Allow ordering of the list of roles
    
shadcn’s picture

Status: Reviewed & tested by the community » Fixed

Patch committed. Thanks everyone :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.