Hi,
I noticed that it's impossible to create a normal core menu entry that point to an Auto Assign Role "Assign from path" url. It say that the path is invalid or we don't have access to it.
I first thought that, because I'm admin, I can't create a path that go to register page because I'm logged and so, I can't go to the register page. But I can create a menu entry to user/register path, so this is an Auto Assign Role issue I think.
So it would be great to fix it and let website admins create menu entry to their favorite Auto Assign Roles registration page as they want.
PS : It is actually doable by creating a module that implement hook_form_alter() for the menu item creation form and that remove the validation function. This is a dirty fix, but it would allow people to create menu entry as they want by waiting a fix.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 538608.11-autoassignrole-menu.edit_.patch | 483 bytes | mrfelton |
| #10 | 538608.10-autoassignrole-menu.edit_.patch | 2.66 KB | mrfelton |
Comments
Comment #1
zmove commentedHere is the snippet to put in a custom module to allow it (I repeat it's dirty ;) )
But it will create another problem. If you create a menu entry that point to the Auto Assign Role Path, it will be invisible in admin (I suppose that's because we don't have access to it). So, to be complete, Auto Assign Role have to alter the menu items display to show that menu entry, or it will be only alterable by editing the database directly.
Comment #2
cyberswat commentedI think this has been fixed and is in the latest versions.
Comment #4
chill8331 commentedI see the newest version is about to create a menu item under the navigation menu. It still impossible to create menu entry when i want though. For instance, I was trying to create a menu entry under primary menu which is the navigation menu in my website. why is still telling me "invalid or you do not have access to it"? Could anybody fix this please?
Notes: In the "display method" i selected menu item. It created a menu item under navigation. But it gave me error when i want to move it under other menu item("invalid or you do not have access to it"). which means is not editable.
Comment #5
hmolky commentedHi
I've used auto assign role path with content_profile so that different registrations appear for different roles . This is great but the problem is that the menu entries for those paths only appear for anonymous users.
I want to restrict the creation of new users for users with "admin" role (that means these users are "authenticated") , I don't want anyone entering the site to be able to create a user.
I think this is not possible with AAR version 6.x-1.1 because when any user logs in, the menu entries that have been created by AAR path disappear and upon log out they appear again. (unless I choose the option "Only site administrators can create new user accounts" in user settings page in that case these links never appear neither with authenticated nor with anonymous users).
Maybe I'm not using the module in the right way.
Any help will be appreciated.
Comment #6
hmolky commentedand another thing , I couldn't create a menu entry to user/register path as "zmove" mentioned first.
Or at least couldn't see it unless I log out (which then will not be useful because this menu entry already exists)
This is the same behavior for links created by AAR path.
Comment #7
eugen80 commentedI'm using version 1.2 and i have same problem.
I try to create a link to user/register/family to primary menu without success: The path 'user/register/family' is either invalid or you do not have access to it.
Admin cannot access the path, guest can access it.
Comment #8
arski commentedHey,
This issue comes about only when you're editing a menu item, however, adding a new menu item with the link set to a AAR path will work.
The reason is the function _autoassignrole_path_access() which has the following option to return TRUE:
However, the path when editing a menu item is something like "admin/build/menu/item/668/edit" so obviously the above fails..
Enjoy :)
Comment #9
stephesk8s commentedSame problem here with 6.x-2.0-beta1. I can add a menu item, but when editing it I get the "invalid or you do not have access to it" error. Not a deal breaker, but inconvenient to have to delete and re-add the menu item to modify it.
Comment #10
mrfelton commentedAttached patch gets rid of the _autoassignrole_path_access function, and instead uses core's user_register_access access check for these items. Seems to work for me, though I haven't done any extensive testing.
What was the purpose of _autoassignrole_path_access()? What did it do over and above what core's registration form access checks do?
Comment #12
mrfelton commentedLast patch may have been a bit ambitious. How about this one.