Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip adding 'Name' for user template when it is using a different parent to default #795

Closed
postscript-chris opened this issue Jan 21, 2019 · 10 comments

Comments

@postscript-chris
Copy link

postscript-chris commented Jan 21, 2019

I followed the steps here to create users in a different parent to the default:

https://processwire.com/blog/posts/processwire-core-updates-2.5.14/#multiple-templates-or-parents-for-users

This is awesome, so glad I found it and it is working as expected. However if I populate 'Name format for children' in the parent template, nothing works. When I go to add a new user underneath the new parent this takes me to:

'access/users/edit/bookmarks/bookmarks/bookmarks/bookmarks/'

'Name' is completely irrelevant to the system I am building and it will just require an email so I was going to auto populate it with an ID or something like member-NUM.

ProcessWire 3.0.124

@ryancramerdesign
Copy link
Member

I'm not sure you'll be able to utilize the name format for children on users because the primary identifier for users is name, and they still have to be unique regardless of parent. So the equation is different than for regular pages. Though I'm not sure why it's redirecting you to a bookmarks page, it should definitely degrade more gracefully than that, so I'l need to get a closer look. What is the name format you are trying to use? Btw, It should be fine if you want to use email for login, so long as they are unique.

@postscript-chris
Copy link
Author

Hi Ryan, cheers for getting back to me on this.

You can set the title as anything and it will still go to the bookmarks URL.

I am using email address for people to login, that's working fine, I just want to skip setting the name as it is an unnecessary step for an admin and they may become confused. I achieved this with a hook in the end, and this also adds the correct role. I then set the name on saveReady to something we could possibly use in the future distributor-0001 as an example. However even if you set a name format this would still be unique and handled by ProcessWire wouldn't it?

Side note, normal users who are editors in ProcessWire are added in the normal way in my system so name is the primary identifier and unique, so it would be great if this is easy to change. I think it is a pretty advanced feature so people will understand the do's and don't. Although if it cant be changed my hooks are working ok.

@netcarver
Copy link
Collaborator

@ryancramerdesign Is this a not-a-bug situation?

@ryancramerdesign
Copy link
Member

@netcarver since PW requires name for user (and roles and permissions), it's not designed to be skipped over (page name format) at the admin level. But what sounds like a potential bug here is the bookmarks thing, which I'm not sure I understand yet. Though if it only appears as a result of using the page name format on a system template, then I don't think we need to do anything other than maybe move to requests repo as feature to support skipping name for users. @postscript-chris I'm curious what name format are you using? I might be feasible to support the "email" field here, since it is required on templates representing users.

@postscript-chris
Copy link
Author

I will check again and report back next week when I am working on this particular site.

@reminders reminders bot added the reminder label Feb 8, 2019
@postscript-chris
Copy link
Author

postscript-chris commented Feb 11, 2019

@ryancramerdesign so I tried:

title
email (I knew this wouldn't work)
Y/m/d H:i:s

I suppose what I am struggling with here is you are saying they need a name, but they will have a name even using 'title', or 'Y/m/d H:i:s', ProcessWire would make sure they had a unique name.

@reminders reminders bot removed the reminder label Feb 22, 2019
@reminders
Copy link

reminders bot commented Feb 22, 2019

👋 @netcarver, review this issue

ryancramerdesign added a commit to processwire/processwire that referenced this issue Feb 28, 2019
@ryancramerdesign
Copy link
Member

@postscript-chris I think I've resolved the bookmarks redirect issue, and looks like it also enables you to use the pageNameFormat for users now as well. Please try it out and let me know how it works for you. Btw, using "email" for the child page name format should be fine, as it can be any field name present on the template.

@netcarver
Copy link
Collaborator

@postscript-chris Could you review the fix and close the issue, if appropriate. Thank you!

@processwire processwire deleted a comment from reminders bot Mar 8, 2019
@netcarver
Copy link
Collaborator

@postscript-chris Closing this now. Please post more if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants