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.
function email_registration_form_user_profile_form_alter($form, &$form_state) {
$form['account']['name']['#title'] = t('Display name');
}
The parameter should be &$form to make this function work.
Comment | File | Size | Author |
---|---|---|---|
#7 | email_registration-hook-fix-2166607-6.patch | 867 bytes | Anonymous (not verified) |
#4 | email_registration-hook-fix-2166607-4.patch | 1.39 KB | Anonymous (not verified) |
Comments
Comment #1
gregglesBoth ideas make sense to me. Patch coming?
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedPatch to fix the hook bug.
Comment #5
gregglesThe form_alter change makes sense to me, but should it be passed by reference in a _validate function?
I looked for some examples in core and it seems like core does not pass $form by reference in validate functions.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedIn this case, reference is more lightweight, because no full copy of form is passed.
Attached the path without the _validate change.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #8
gregglesThanks @Dudytz!
What do you think about this piece:
Comment #9
gregglesActually forget #8. I just remembered #657472: Add setting to allow users to login with email address or username where we discuss that idea and maybe even implemented it. So, removing that from this issue.
@Jody - please take a look over there?
Comment #10
gregglesOne more thought!
The tests all pass, but how about adding a test for this specific feature to make sure we keep it working in the future? Thanks, Dudytz!
Comment #11
gregglesThanks!
Committed with credit http://drupalcode.org/project/email_registration.git/commit/c22e517