Problem/Motivation
I have no idea how, but I have found several times that the checkmarks for menu items under the menu item visibility tab are spontaneously reset, opening up this menu item for all users.
I would like to provide more debug info, or even a way to reproduce this, but I haven't yet figured out where to look. No errors or notices in my log. I will add more feedback if I come across anything.
Steps to reproduce from #5
To reproduce, simply configure a menu item and limit it to a specific role. Save. Then, move the item so that it becomes a parent or child of another menu item in the hierarchy. Save. The visibility settings will be reset.
Comment | File | Size | Author |
---|---|---|---|
#25 | settings_are_reset_when-1369480-25.patch | 866 bytes | joelpittet |
#7 | menu_item_visibility-fix_for_roles_being_reset_when_moving_menu_items-1369480.patch | 1.29 KB | Anonymous (not verified) |
Comments
Comment #1
daniel_d CreditAttribution: daniel_d commentedThis small module is very useful.
Though I experience possibly the same problem described here while changing a node which already has a menu item edited with roles set by this module. The result is that a new menu item, with the same name, is created and both have lost their checkmarks.
I presume that the content editor doesn't recognise the menu item anymore (therefor creating a new one). This might also be a hint toward the problem of the lost checkmarks.
Comment #2
kingfisher64 CreditAttribution: kingfisher64 commentedWould like to use this handy little mod instead of http://drupal.org/project/menu_per_role however this looks like it just needs a bit of fine tuning. Has any progress been made with this issue?
Comment #3
Dave ReidWell I haven't ever been able to duplicate this and comment #1 indicates that something else might be going on that doesn't necessarily mean this module has a bug. It would be helpful if someone could reproduce this issue with a fresh install of Drupal core only plus this module.
Comment #4
kingfisher64 CreditAttribution: kingfisher64 commentedRight so there's a ghost in the machine somewhere else. Will bear that in mind when viewing bugs in general within drupal mods.
Thanks Dave for taking the time to reply.
Comment #5
ptmkenny CreditAttribution: ptmkenny commentedI was able to reproduce this from a fresh install of Acquia Drupal.
To reproduce, simply configure a menu item and limit it to a specific role. Save. Then, move the item so that it becomes a parent or child of another menu item in the hierarchy. Save. The visibility settings will be reset.
Comment #6
ptmkenny CreditAttribution: ptmkenny commentedComment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedI was having the same problem, I fixed it with a simple check before deleting the role information in _menu_item_visibility_menu_link_update($link).
The proper fix would be to see why $link doesn't get the roles attribute added when moving a menu item. It works fine for editing a menu item.
Comment #8
exode785 CreditAttribution: exode785 commentedThank you, is good for me !
Comment #9
xaa CreditAttribution: xaa commentedhello,
I had the same issue with links created by taxonomy_menu (default visibility setting after node update).
patch #7 working. Thank you.
Comment #10
mkalkbrennerjust updated the status to the correct value.
Comment #11
retiredpro CreditAttribution: retiredpro commented#7 worked against the latest dev release for me. Thank you.
Comment #12
massiws CreditAttribution: massiws commented#7 works fine also in 7.x-1.0-beta1 release.
Thank you!
Comment #13
drupixI had the same problem when saving a node who has a menu item.
#7 and 7.x-1.0-beta1 worked
Thank's
Comment #14
ngreenup CreditAttribution: ngreenup commentedI had the same problem. The patch in comment #7 worked for me.
Comment #15
NancyDruCan we get this committed, please?
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedThank you for the patch #7.
Comment #17
legolasbomarked #2318139: Must save "Show menu link for specific roles" setting twice for it to work as a duplicate.
Comment #18
unqunq CreditAttribution: unqunq commentedThe patch in comment #7 worked for me. Thanks.
Comment #19
ergonlogicI've seen this behaviour occur when simply saving a node that is providing a menu item. Even without any changes to the node in question, the associated visibility settings are lost on the menu item. The patch in #7 appears to have resolved the issue.
I'm bumping the priority to critical, since this bug causes loss of data (the menu visibility settings themselves) and exposes security vulnerabilities (menu items become visible to roles that ought not see them). Admittedly, this is arguable, especially since this module doesn't pretend to secure access to path or anything...
Comment #20
hkovacs CreditAttribution: hkovacs as a volunteer commented#7 in 7.x-1.0-beta1 works for me.
Comment #21
kubrt CreditAttribution: kubrt commented#7 in 7.x-1.0-beta1 works for me too. Have also been getting this behaviour when simply saving a node that is providing a menu item.
Comment #22
joelpittetChanging to the branch it will be applied to. There are no automated tests on the module but steps to reproduce this would be nice to add to the issue summary.
Comment #23
NancyDruSee #5.
Comment #24
joelpittetThanks, added to issue summary
Comment #25
joelpittetRe-rolling to test
Comment #28
joelpittetTested and yup it does fix the issue. I've committed it to dev. Thank you all for helping resolve this issue.
Sorry messed up the commit message/attribution, that's why there is two commits
Comment #29
NancyDruThanks.