Jump to content
thetuningspoon

Can't add new user page of a different template

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.

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

Just came across this thread again after running into this issue again on a new project. It's still a problem. Right now I can only create new users with an alternate template from the the Access/Users page, which does not fit my needs.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...