Problem/Motivation

After account creation and activation, the user (normally) receives an email with a one time login link that can be used to change their password. When this link is clicked, the title of the page redirected to is 'Reset Password'.

This string is not translateable (and should be).

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task because it's "rewriting user interface strings for brevity and clarity."
Issue priority Normal because "affects one piece of functionality are normal priority".
Unfrozen changes Unfrozen because it only changes (adds) translateable strings and changes tests only.
Prioritized changes The main goal of this issue is usability.
Disruption Not disruptive.

Proposed resolution

I think that 'Set password' would be more appropriate when no password exists, while 'Reset Password' for when a password already exists.

Both strings should be translateable.

Remaining tasks

Contributor tasks needed
Task Novice task? Contributor instructions Complete?
Add automated tests Instructions
Update the patch to incorporate feedback from reviews (include an interdiff) Instructions

User interface changes

Set page title to 'Set Password' or 'Reset Password' depending on whether a password already exists.

API changes

None.

Original report by @Bram Tassyns

Comments

dcam’s picture

Version: 7.28 » 8.x-dev

I'm not certain, but I think this is still the case in 8.x. If it is, then it will have to be changed there first.

jeet09’s picture

Issue tags: +#SprintWeekend2015, +#user module
StatusFileSize
new765 bytes

Changed title from Reset Password to Set Password for one time login.

David Hernández’s picture

Status: Active » Needs review

Hello!

Thank you for working on this issue!

We should all try and use the same sprint tag. According to https://groups.drupal.org/node/447258 it should be SprintWeekend2015 with no #.

Also, if you want the testbot to execute the tests, you should check the status to Needs Review.

David Hernández’s picture

Issue tags: -#SprintWeekend2015 +SprintWeekend2015
Anonymous’s picture

We've taken a look at this here at the Toronto #SprintWeekend and we're proposing the following change.

"Reset Password" isn't wrapped with t() and the form is used for both password resets and one time login so the title should change to reflect that.

pierremarcel’s picture

Status: Needs review » Reviewed & tested by the community

Great catch mhazy, I've tested the patch and it's working no problem. Great usability fix guys!

alimac’s picture

Category: Feature request » Task
Priority: Minor » Normal
Issue tags: +Needs backport to 7.x, +Needs issue summary update

I'm doing a beta evaluation of this issue.

Setting the issue category to Task because it's "rewriting user interface strings for brevity and clarity."

Setting the issue priority to Normal because "affects one piece of functionality are normal priority". It's not a cosmetic change because it adds clarity to the wording and two translateable strings.

It's a prioritized change, because it falls under usability and user experience improvements. It can also be backported to D7.

The issue summary needs to be updated to mention that "Reset Password" is not currently a translateable string and should be.

alimac’s picture

Issue summary: View changes
alimac’s picture

RavindraSingh’s picture

+1, works for me perfectly.

alimac’s picture

Issue tags: -Needs backport to 7.x +Needs backport to D7
alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests
+++ b/core/modules/user/src/Form/UserPasswordResetForm.php
@@ -72,13 +72,14 @@ public function getFormID() {
+      $form['#title'] = t('Reset Password');
...
+      $form['#title'] = t('Set Password');

$this->t() should be used here.

The title with/without password should be tested.

alimac’s picture

Issue summary: View changes
alimac’s picture

Issue summary: View changes
alimac’s picture

Status: Needs work » Needs review
StatusFileSize
new2.04 KB
new2.03 KB

Updated patch, plus one test for 'Reset Password' string. Setting to Needs Review to trigger testbot but it still needs another test for the other string, probably in UserRegistrationTest.php.

Status: Needs review » Needs work

The last submitted patch, 15: 2297185-password-reset-form-title-15.patch, failed testing.

alimac’s picture

Status: Needs work » Needs review
StatusFileSize
new2.05 KB
new2.04 KB

One more time: updated patch, plus one test for 'Reset Password' string. Still needs a test for the 'Set Password' string.

alimac’s picture

Added test for 'Set Password' after registration. I'm sure there is a better way to do this than copying the getResetURL function, though, so this part still needs work.

Anonymous’s picture

Changed to use user_pass_reset_url to generate the reset URL instead of finding it in the email

alimac’s picture

Status: Needs review » Needs work

@mhazy, good to know about user_pass_reset_url.

  1. +++ b/core/modules/user/src/Tests/UserRegistrationTest.php
    @@ -277,5 +280,4 @@ function testRegistrationWithUserFields() {
    -
    

    Need to leave in that blank line before the very end of a class, per https://www.drupal.org/node/608152

RavindraSingh’s picture

StatusFileSize
new3.17 KB

Perfact @alimac, Just added that line as well in updated patch. and Good work @mhazy

alimac’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 21: 2297185-password-reset-form-title-20.patch, failed testing.

alimac’s picture

StatusFileSize
new61.14 KB

@RavindraSingh: there are extra spaces on that blank line that need to be deleted:

When you post a patch, it is a good idea to also post an interdiff, to show the difference from one patch to the next: https://www.drupal.org/documentation/git/interdiff

I am not sure why this patch failed testing, the failing tests appear to be cache related..

adci_contributor’s picture

Status: Needs work » Needs review
StatusFileSize
new513 bytes
new2.93 KB

Cleaning the whitespaces

alimac’s picture

Issue tags: +LatinAmerica2015
cepinos’s picture

Perfect!, It works for me.

I Applied this patch locally, and I did a visual review of it.

It is what I did. I created an account, and then It sent me an email, asking me set my password. Before the patch, It was showing reset Password in the title, and after apply this patch, It shows Set password in the title.

There is not test only patch, so we cannot confirm the patch at #25 includes a working test.

cepinos’s picture

Status: Needs review » Reviewed & tested by the community

Perfect!, It works for me.

I Applied this patch locally, and I did a visual review of it.

It is what I did. I created an account, and then It sent me an email, asking me set my password. Before the patch, It was showing reset Password in the title, and after apply this patch, It shows Set password in the title.

There is not test only patch, so we cannot confirm the patch at #25 includes a working test.

cepinos’s picture

Issue summary: View changes
StatusFileSize
new100.97 KB
new101.2 KB

Some screenshots from my review:

Before:
Before

After:
After

cepinos’s picture

Status: Reviewed & tested by the community » Needs review

Going to reopen this to manually test the multilingual functionality to ensure both "Reset password" and "Set Password" are translatable strings now.

cepinos’s picture

"Reset Password" and "Set Password", are technically wrong, It should be "Reset password" and "Set password" as is recommended in here https://www.drupal.org/node/84146

cepinos’s picture

This is a test only patch. I am doing this because I learned it from Dupalcon Bogotá. It is a good practice, because if it fails before apply the patch commented at #25 this means that the test works.

Status: Needs review » Needs work

The last submitted patch, 32: password-reset-form-title-2297185-25-test-only.patch, failed testing.

yesct’s picture

Status: Needs work » Needs review

that was a tests only patch. which failed nicely. this is needs review.

alimac’s picture

Issue summary: View changes
alimac’s picture

Patch with the word password in lowercase for the title. Wrong patch, ignore.

alimac’s picture

Patch with the word password in lowercase for the title.

yesct’s picture

Issue tags: -Needs tests
StatusFileSize
new179.38 KB

I'm not sure if that old issue (referenced in #31) clarifies the casing,
but
the reset your password page title is "Reset your password"

in head right now.

also looked using
ag '\$form\[.#title.\] = '
for example in head. and lower case seems used else where in core.

has tests. so removing the needs tests tag.

alimac’s picture

Patch with the word password in lowercase for the title.

yesct’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

I read the patch and discussed this. (if green) rtbc.

alexpott’s picture

Version: 8.0.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed df0bde0 and pushed to 8.0.x. Thanks!

Thanks for adding the beta evaluation to the issue summary and it's great to see a test for the logic.

I'm not sure that this can be backported since it changes UI text - won't translations have to be changed?

  • alexpott committed df0bde0 on 8.0.x
    Issue #2297185 by alimac, cepinos, mhazy, adci_contributor, YesCT,...
alexpott’s picture

Version: 7.x-dev » 8.0.x-dev
Status: Patch (to be ported) » Fixed

Reading https://www.drupal.org/node/1527558 - this is not eligible for backport.

Status: Fixed » Closed (fixed)

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

xjm’s picture

Issue tags: -Needs backport to D7

Removing the tag per #43.