Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When creating a new user as an admin, it is useful and even expected to be able to complete all the profile fields which are available on the usual registration form ... the approach might be to consolidate registration so that both users and admins use a single form.
Comment | File | Size | Author |
---|---|---|---|
#6 | user_reg_1.patch | 8 KB | chx |
#5 | user_reg_4.6.2.patch | 8.33 KB | Torenware |
#4 | user_reg_0.patch | 9.01 KB | chx |
#1 | user_reg.patch | 8.69 KB | chx |
Comments
Comment #1
chx CreditAttribution: chx commentedAt first I thought it'd be better if I'd keep the separate form, but this version results in shorter code and it's not so ugly. However, if you do not like it, I have the version which only adds the
$extra
touser_admin_create
.Comment #2
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedI like this patch.
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedto me, this version is great as it unifies the registration code. i did a code review and all looks good to me. i applied the patch and noticed that
- i added a required checkbox field via profile.module. the check appeared on the reg form without the 'required' marker and the registration was accepted without checking the box. then i tried this for a textfield and it properly showed the 'required' marker but it didn't enforce the 'required' bit either. so then i tried to edit the user and even then we seem not to be enforcing the 'required' bit. this looks like a profile.module bug.
if you are up for it, you might want to investigate the above. but truly, enforcing the required bit is not related to this patch. so +1 from me.
Comment #4
chx CreditAttribution: chx commentedIt was intentional that the check for required fields are skipped for admins. I deleted that check.
Comment #5
Torenware CreditAttribution: Torenware commentedThis patch is massively useful (at least for me...) and was exactly what I was looking for.
Since I can't use the CVS version, I back-ported it to 4.6.2. It's syntactically valid, and it seems to work, although I have not tested it thoroughly. I'm uploading it in case anyone else wants to try it out, or is willing to test it. I'll be using it in any case.
YMMV, of course :-)
Rob Thorne
Torenware Networks
Comment #6
chx CreditAttribution: chx commentedafter discussions with Dries and Moshe I put the requirement uncheck and removed my description trickery.
Comment #7
moshe weitzman CreditAttribution: moshe weitzman commentedI applied the patch and registered as regular user and as admin. works as advertised.
code looks good, and consolidates the registration forms so we don't have special admin only form. +1
Comment #8
Dries CreditAttribution: Dries commentedCommitted to HEAD. Thanks.
Comment #9
(not verified) CreditAttribution: commentedComment #10
(not verified) CreditAttribution: commented