/**
 * Implements hook_form_FORM_ID_alter().
 */
function email_registration_form_user_pass_alter(&$form, &$form_state) {
  $form['name']['#title'] = t('E-mail');
  $form['name']['#description'] = t('A password reset message will be sent to your e-mail address.');
}

These seem like pointless changes to me, and out of scope of the module:

- 'Username or e-mail address' -> 'E-mail'

Given we are not changing this form in any functional way, I assume a username will continue to work, despite our no longer announcing it.

> $form['name']['#description'] = t('A password reset message will be sent to your e-mail address.');

This is an addition -- core has nothing here. The button text is presumably descriptive enough. If not, it's a bug to file on core. It seems to me to be out of this module's scope to fix this sort of thing.

Comments

greggles’s picture

Title: don't change the password reminder form » Don't change the password reminder form too much

My sense from the issue queue is that for many users of the module it is confusing UX to show "username" inside the site. So, I'm inclined to keep the alter of the ['name']['#title']. If a specific site wants to change the message that would be fine for them to do in their own code/config.

I would be fine dropping the description.

joachim’s picture

Status: Active » Postponed

> - 'Username or e-mail address' -> 'E-mail'

This change makes sense for now (well, technically, it's lying by omission, as the logic behind the form will still allow use of the username!).

Once #657472: Add setting to allow users to login with email address or username gets in though, it should change conditionally on the setting introduced by that patch.

greggles’s picture

Status: Postponed » Needs review
StatusFileSize
new495 bytes

How about this?

joachim’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me!

+++ b/email_registration.module
@@ -121,7 +121,6 @@ function email_registration_form_user_register_form_alter(&$form, &$form_state)
   $form['name']['#title'] = t('E-mail');

Changing this to 'Username or e-mail address' will then be part of #657472: Add setting to allow users to login with email address or username.

greggles’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new495 bytes

And just for posterity...I plan to commit this :)

greggles’s picture

greggles’s picture

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

right?