Needs review
Project:
Menu Subtree Permissions
Version:
5.x-0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Sep 2007 at 23:27 UTC
Updated:
8 Mar 2009 at 23:46 UTC
Jump to comment: Most recent file
Comments
Comment #1
wotsoft commentedI had the same problem.
I found the problem in the code and wrote a patch.
Check it out!!!
Comment #2
egfrith commentedOoops. I have solved this issue independently at #288727: Menu settings do not show for the authenticated user role, having overlooked this bug. However, to keep the bug discussion together, I'll post my patch here. It follows the same principle as the one here, but is in my view neater, reducing the code count significantly:
I can confirm that the module does not work when the "authenticated user" role is used to designate the subtree. The problem is that the module was assuming that the information about roles is kept in the users_roles tables. This is not true for the authenticated user role. Instead, as demonstrated at http://api.drupal.org/api/function/user_access/5 , the information is already cached in the $user object.
The attached patch obtains the role ids in _menu_stp_alter_node_edit_form() by from array_keys($user->roles) . The function _menu_stp_user_roles() is deleted, as it only appears in _menu_stp_alter_node_edit_form() and it only requires one extra line in _menu_stp_alter_node_edit_form() .