apeisa / UserGroups

Adds users groups and page based permission to ProcessWire
GNU General Public License v2.0
11 stars 4 forks source link

Getting "Template 'user' is not allowed here." when adding a user #38

Closed artarmstrong closed 9 years ago

artarmstrong commented 9 years ago

When I am trying to add a new user by going to Access > Users > Add New I am getting this error popping up on the screen. The page url structure is "/admin/access/users/add/".

If I go to Access > Users then click the "Add New", which takes me to "/admin/access/users/add/?parent_id=29" then I am able to add a user.

Any help on this?

screen shot 2014-12-30 at 10 00 00 am

artarmstrong commented 9 years ago

Heres a screenshot with debug on: screen shot 2015-01-01 at 10 47 36 pm

teppokoivula commented 9 years ago

@artarmstrong I've definitely seen this before, but can't remember where and when. Will debug later, but for the time being, can you confirm that this is an issue caused by UserGroups, not by ProcessWire itself?

If you try adding a user to this site without UserGroups installed, or another site on the same server (and with same ProcessWire version), does it work as expected then?

artarmstrong commented 9 years ago

Just verified. Created a new installation with same version but not using "UserGroups" and was able to get to the screen and add a user with no issues.

Only other thing I could think of was that the site having issues was recently upgraded from 2.4 to 2.5.3.

teppokoivula commented 9 years ago

For the record, this is actually same issue as #37.

When ProcessPageAdd is instantiated in ProcessPageType, it gets parent_id from ProcessPageType directly. UserGroupsHooks on the other hand looks for POST and GET params, and if neither is found, defaults to '1' as the parent_id. In this case this is obviously wrong behaviour.

I've got a potential fix for this, but I'll post details (and/or push an update to UserGroupsHooks) once I've tested it a bit more.

artarmstrong commented 9 years ago

Fantastic! I look forward to testing it. Thanks for the update!

teppokoivula commented 9 years ago

@artarmstrong, latest commit should fix this issue. Please let me know if it works for you -- so far it does seem to work in my test cases, and I haven't found any unwanted / harmful side-effects either.

artarmstrong commented 9 years ago

Just tested and worked great. Thanks for the update.