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.

CommentFileSizeAuthor
#7 email_registration-hook-fix-2166607-6.patch867 bytesAnonymous (not verified)
#4 email_registration-hook-fix-2166607-4.patch1.39 KBAnonymous (not verified)
#2 email_registration-hook-fix-2166607-2.patch1.37 KBAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greggles’s picture

Both ideas make sense to me. Patch coming?

Anonymous’s picture

Anonymous’s picture

Assigned: Unassigned »
Status: Active » Patch (to be ported)
Anonymous’s picture

FileSize
1.39 KB

Patch to fix the hook bug.

greggles’s picture

Status: Patch (to be ported) » Needs review

The 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.

Anonymous’s picture

In this case, reference is more lightweight, because no full copy of form is passed.
Attached the path without the _validate change.

Anonymous’s picture

greggles’s picture

Thanks @Dudytz!

What do you think about this piece:

Also I think it would be nice to have an option to remove the username field from user editing, to simplify the form.

greggles’s picture

Issue summary: View changes

Actually 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?

greggles’s picture

One 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!

greggles’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.