Problem/Motivation
When creating a new account from /admin/people/create and set the user name, it always takes the first part of the email, until save and edit the user then change the name to take a new name.
Steps to reproduce
- Install Drupal
- Install and enable the Email Registration module.
- Go to /admin/people/create
- Fill in the fields and change the user name.
- Submit the form.
- After submitting the form, the user name is not as it was filled before, it will be the first part of the email.
Proposed resolution
I suggest in email_registration_form_user_form_alter to give the user name default value rather than value, by replace
$form['account']['name']['#value'] = 'email_registration_' . user_password(); with
$form['account']['name']['#default_value'] = 'email_registration_' . user_password();
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 3276910-11.patch | 671 bytes | sourabhjain |
| #4 | 3276910-3.patch | 661 bytes | qusai taha |
Issue fork email_registration-3276910
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
qusai taha commentedPatch to fix the issue on 8.x-1.1 version
Comment #4
qusai taha commentedComment #5
qusai taha commentedComment #6
ericgsmith commentedHave reviewed and tested this patch and it fixes the issue.
Comment #7
gregglesThanks for the wonderful bug report, patch, and review. This seems to apply to 8.x-1.x but not to 8.x-1.x-dev.
Could you test this same bug against the current 8.x-1.x-dev and see if the problem is still there? If not I will roll a new release to get the fix into more sites.
Comment #8
qusai taha commentedHello @greggles
I tested the bug on 8.x-1.x-dev and the issue exists on it.
Comment #9
gregglesHmm, then I think this needs to go back to needs work because the patch doesn't seem to apply.
Comment #10
sourabhjainI am working on this issue.
Comment #11
sourabhjainI have resolved the issue. Please review.
Comment #12
gregglesI'm not sure why I had difficulty in #7. The patch in #3 is from the wrong base, maybe that was what I tested and caused the problem?
Anyway, I just merged this. Thanks again, all, for your help!
Comment #14
andypostFixed via https://git.drupalcode.org/project/email_registration/-/commit/172ca8223...