/**
* 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
Comment #1
gregglesMy 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.
Comment #2
joachim commented> - '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.
Comment #3
gregglesHow about this?
Comment #4
joachim commentedLooks good to me!
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.
Comment #5
gregglesAnd just for posterity...I plan to commit this :)
Comment #6
gregglesSo, 7.x http://drupalcode.org/project/email_registration.git/commit/406191a
And 8.x - http://drupalcode.org/project/email_registration.git/commit/8d71999
Thanks, Joachim!
Comment #7
gregglesWhoops - committed the wrong thing to 7.x-1.x
Reverted: http://drupalcode.org/project/email_registration.git/commit/d58b932
And the right thing: http://drupalcode.org/project/email_registration.git/commit/ff75c20
Comment #8.0
(not verified) commentedright?