When you have a menu per role, all the role weights that you've set on the template config page have to be different because of this statement in the template.php:
array_flip

this statement turns the weights into the keys. so basically duplicate keys overwrite each other.

therefore i turned lines 49 and 50:
$filter_out = array_keys($user->roles);
$roles = array_intersect(array_flip($role_weights), $filter_out);

into this:
$roles = array();
foreach($user->roles as $rid => $role) {
$weight = $role_weights[$rid];
if(!empty($weight)) {
$roles[$weight] = $rid;
}
}

CommentFileSizeAuthor
#1 rootcandy_weights_menus.patch5.81 KBsign

Comments

sign’s picture

Version: 6.x-1.0-rc5 » 6.x-1.x-dev
StatusFileSize
new5.81 KB

was experimenting with this a bit today
this is a good catch, however there is another bug, when user selects two same weights it gets messed up.

here is a patch (work in progress) which does some stuff with role weights and navigation, especialy introducing drag and drop in admin theme settings, http://www.flickr.com/photos/30032901@N04/3497772378/

and yes, it needs a lot of work...

sign’s picture

Status: Needs review » Needs work
wonder95’s picture

Any chance this will be fixed soon? The error messages from this other one (marked as a duplicate of this issue) are getting old.

Thanks.

sign’s picture

I'll do my best to fix this tomorrow

sign’s picture

Status: Needs work » Needs review

I have commited this patch to dev version. It needs some finishing touches, but should work ok. Please test the dev version

wonder95’s picture

This fixed my issue.

sign’s picture

Status: Needs review » Fixed

great stuff. Thanks for testing

Status: Fixed » Closed (fixed)

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