Hi,

I don't know if I'm doing something silly, but I've followed the README and it doesn't seem to work at all. I'm not clear what permissions users should have for "administer menus". Should they all have that permission, or none and your module sorts it out? I tried both ways and neither behaved as expected.

First, I tried to hide the admin_menu module's menu from normal users by setting the permissions on the whole menu. I got an error saying the menu name was required and could not save.

So I tried the same thing on a custom menu. This time no errors, but the menu was still visible to excluded roles on the node edit form. I removed the "administer menus" permission from the excluded roles to see if that would cause a subset to be shown, but it just removed the interface completely. =(

So I tried the same with menu items further down the tree of the Navigation menu. Settings were saved without issue, but again, menu items still showed to excluded roles.

I'm not sure if this module is totally broken or I'm doing something stupid. Any suggestions?

CommentFileSizeAuthor
#9 root-menu-items-625360-2586746.patch657 bytessillygwailo

Comments

Hk001’s picture

Doesn't work for me either. When administer menu is on, then the user sees everything in the dropdown box. When administer menu is off, then the dropdownbox is empty, even when the userrole was assigned several menu's.

Maybe it's a bug in 6.x-1.1.

Hk001’s picture

In menu_stp.module something's wrong with adding entries to the table . Entries for the table menu_stp_menu_roles are added, entries for the table menu_stp_roles aren't.

I'm guessing that this is something in the part from line 353 to 364, but I'm not sure. Any help would be great.

Hk001’s picture

Although not a very neat solution, I got it almost working as I wanted.

In the file menu_stp.module, change the following line(215):
$result = db_query("SELECT DISTINCT mlid FROM {menu_stp_roles} WHERE rid IN (" . db_placeholders($rids, 'int') . ")", $rids);

Into:
$result = db_query("SELECT ml.mlid FROM menu_stp_menu_roles ms INNER JOIN menu_links AS ml ON ml.menu_name = ms.menu_name where ms.rid IN (" . db_placeholders($rids, 'int') . ")", $rids);

In other words: the table menu_stp_roles stays empty. Therefore we use the menu_names from the table menu_stp_menu_roles and with these we can get the necessary menu id's from the table menu_links.

Now users get only to see the parts of the menu they are permitted to see. However, root menu items can only be added when the option 'Administer menu' in role permissions is checked. For everything else, it works. I hope you've set a nice machine-readable-name for your menu's, because that's what is shown in the list as the rootname.

I say again: the module still needs to be fixed by the creator, but for now this is a solution.

israelshmueli’s picture

subscribe

eliza411’s picture

I tried both the release and the dev version. When I assign a role to a menu item via menu_stp there seems to be no effect. The menu subtree isn't available to the role on the node page. When I return to the menu item, the role's checkbox isn't checked. I'm not sure what to try next, so any pointers are greatly appreciated.

drasgardian’s picture

I didn't have any luck with this module either. When creating a node the 'Parent Item' field didn't offer any options.

todd zebert’s picture

subscribe

guille.castano’s picture

The same happens to me.
I've unchecked "administrar menú" (menu management) on user permissions and now it works fine

sillygwailo’s picture

Status: Active » Needs review
StatusFileSize
new657 bytes

Patch, based on dev, from #3, attached.