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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

daniel_d’s picture

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

kingfisher64’s picture

Would 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?

Dave Reid’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

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

kingfisher64’s picture

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

ptmkenny’s picture

Status: Postponed (maintainer needs more info) » Active

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

ptmkenny’s picture

Title: Settings are sometimes reset - all checkmarks gone » Settings are reset when items are moved in the menu hierarchy
Anonymous’s picture

Component: User interface » Code
Status: Active » Patch (to be ported)
FileSize
1.29 KB

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

exode785’s picture

Thank you, is good for me !

xaa’s picture

hello,
I had the same issue with links created by taxonomy_menu (default visibility setting after node update).

patch #7 working. Thank you.

mkalkbrenner’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

just updated the status to the correct value.

retiredpro’s picture

#7 worked against the latest dev release for me. Thank you.

massiws’s picture

#7 works fine also in 7.x-1.0-beta1 release.
Thank you!

drupix’s picture

I had the same problem when saving a node who has a menu item.
#7 and 7.x-1.0-beta1 worked
Thank's

ngreenup’s picture

I had the same problem. The patch in comment #7 worked for me.

NancyDru’s picture

Issue summary: View changes

Can we get this committed, please?

Anonymous’s picture

Thank you for the patch #7.

legolasbo’s picture

unqunq’s picture

The patch in comment #7 worked for me. Thanks.

ergonlogic’s picture

Priority: Normal » Critical

I'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...

hkovacs’s picture

#7 in 7.x-1.0-beta1 works for me.

kubrt’s picture

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

joelpittet’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Issue tags: +Needs issue summary update

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

NancyDru’s picture

See #5.

joelpittet’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

Thanks, added to issue summary

joelpittet’s picture

Re-rolling to test

  • joelpittet committed b377381 on 7.x-1.x
    Issue #1369480 by joelpittet, Karel Bemelmans: Settings are reset when...

joelpittet’s picture

Status: Reviewed & tested by the community » Fixed

Tested 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

NancyDru’s picture

Thanks.

Status: Fixed » Closed (fixed)

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