Jump to content

Can't add new user page of a different template


thetuningspoon
 Share

Recommended Posts

I am taking advantage of the new ability to create users of a template different from "user" and adding them in a different part of the page tree. This is PW3. But when I go to create a new page from the page tree using the alternate user template, some kind of weird redirect happens and I end up on /access/users/edit/bookmarks/bookmarks/bookmarks/bookmarks/

If I remove the alternate "Page Class Name" setting ("User") then I can add new pages again, but the users I create cannot login.

Link to comment
Share on other sites

Hi, unfortunately, I don't have experience with the user template change. But I assume you followed the description of Ryan from here: https://processwire.com/blog/posts/processwire-core-updates-2.5.14/ ? Maybe you can make sure that everything was configured as described, especially the site/config.php part. Also in the hope that everything stayed like that in 3.x :)

However I also had this redirect problem under other circumstances, where a Page could not be created but the error was not properly handled in the code.

Did you check the log files, maybe they give you a hint on the error/problem that is happening here?

Link to comment
Share on other sites

  • 1 year later...

hey its easy, u just have to create a copy of user template for example user-2 template, and also one more template to store user-2 pages as child , for example user2-parent.  now u have to apply set family settings as child and parent.  in site/config.php you have to define userTemplatesId and userPagesIDs.

Then under home create a new page, with user2-parent as its template. Thats it.

Now under users when u add a new user it will  ask you which template you want to use. 

Enjoy. 

Link to comment
Share on other sites

  • 1 year later...

The problem is in ProcessPageAdd on line 1021:

https://github.com/processwire/processwire/blob/649d2569abc10bac43e98ca98db474dd3d6603ca/wire/modules/Process/ProcessPageAdd/ProcessPageAdd.module#L1021

It is calling Page::setEditor, which is overridden by User::setEditor, which performs a redirect instead of actually setting the editor.

Removing this line fixes the issue.

Github issue: https://github.com/processwire/processwire-issues/issues/977

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...