Amendment to the password recovery form error message

Created on 24 July 2017, almost 7 years ago
Updated 10 October 2023, 9 months ago

In the ../core/modules/user/src/Form/UserPasswordForm.php Form we have the following error message:
%name is not recognized as a username or an email address.

As the module allows only the email to be used as login, we need to alter the message accordingly as:

%name is not recognized as a valid email address.

πŸ“Œ Task
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom hugronaphor

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    I guess we should have further tests for the password recovery form's functionality and texts. Any plans to implement a fix here?

    In general, it might make sense to have tests for all texts in core that are altered by this module (in a separate test class) to ensure they are overwritten as expected. Could someone please open a follow-up issue for that general thing?

  • πŸ‡­πŸ‡ΊHungary Balu Ertl Budapest πŸ‡ͺπŸ‡Ί
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • Status changed to Closed: outdated 9 months ago
  • πŸ‡©πŸ‡ͺGermany Grevil

    Not the case anymore. We call a custom validation method through "email_registration_form_user_login_form_alter()", which changes the error message to:

    Unrecognized email address or password. Forgot your password?

    But I agree, we should add a test for that. I'll create a follow-up issue, where we can collect test ideas.

  • πŸ‡©πŸ‡ͺGermany Grevil

    Done, see πŸ“Œ [2.x] Test collection issue Active .

Production build 0.69.0 2024