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;
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | rootcandy_weights_menus.patch | 5.81 KB | sign |
Comments
Comment #1
sign commentedwas 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...
Comment #2
sign commentedComment #3
wonder95 commentedAny chance this will be fixed soon? The error messages from this other one (marked as a duplicate of this issue) are getting old.
Thanks.
Comment #4
sign commentedI'll do my best to fix this tomorrow
Comment #5
sign commentedI have commited this patch to dev version. It needs some finishing touches, but should work ok. Please test the dev version
Comment #6
wonder95 commentedThis fixed my issue.
Comment #7
sign commentedgreat stuff. Thanks for testing