Problem/Motivation
When a Login attempt is unsuccessful due to incorrect username and/ or password being supplied, two sets of information regarding the failure are displayed to the user in two different areas of the page. An error message is displayed in the messages area and a conflicting message is displayed by the inline_form_errors core module inline with the login form elements (i.e. further down the page). Not only do the two sets of output conflict, the output is also factually incorrect.
So, for example, the message "1 error has been found: username" is output, regardless of whether an incorrect username was entered, or if just the password was entered incorrectly, or indeed if both form elements received incorrect input.

For reference, this is what D7 did, hence why this issue is described as a regression:

Steps to reproduce
- Install a Drupal 11 site using the standard profile.
- Ensure that the Inline Form Errors core module is enabled.
- Login to the site using the standard login form at
/user/loginbut enter an incorrect username/ password combination. - Observe the error message output and the inline_form_errors output lower down the page adjacent to the login form itself.
Proposed resolution
Usability meeting determined that skipping the behavior of the Inline Form Errors module for the login form is a good first step [to fixing this issue].
Remaining tasks
Apply the code fix and create test coverage: how about a functional test inside the inline_form_errors module?
User interface changes
N/A
Introduced terminology
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | regressionPatchApply.jpg | 253 KB | shwetaneelsharma |
| #11 | interdiff-6-11.txt | 695 bytes | sdstyles |
| #11 | regression_login_form-2579779-11.patch | 2.55 KB | sdstyles |
| #9 | with.png | 37.94 KB | mgifford |
| #8 | with-n-without.png | 73.85 KB | mgifford |
Issue fork drupal-2579779
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
cilefen commentedComment #3
cilefen commentedComment #4
cilefen commentedComment #6
cilefen commentedComment #8
mgiffordHere's a screenshot without & also with the patch. The one on the right is with the patch above:

Definitely an improvement.
Comment #9
mgiffordSorry screenshot wit the patch was a different width. This one is a better comparison.
Comment #10
cilefen commentedI added the Novice tag because a novice can do the following:
These could be converted to ->assertNoRaw.
Comment #11
sdstyles commentedComment #12
cilefen commentedThis is sort-of the idea and it will probably pass the bots, however, this will not do what you intend—you cannot combine asserts like this with assertNoRaw. The second parameter is supposed to be the test log message. You can't pass additional strings to be checked.
Instead, you would replace the ->assertRaw with ->assertNoRaw and ->assertText with ->assertNoText.
But, this issue may not be necessary if the forms issue that inadvertently caused it is reverted, as seems likely.
Comment #13
Bojhan commentedWhy do we remove the drupal set message, are we special casing this one message?
Comment #14
cilefen commentedYes.
Comment #15
j2r commentedThe patch fail to apply - adding tag 'Needs reroll'
When I try to login with invalid username or password I am getting the correct output - Please check the screenshot.
Comment #16
shwetaneelsharma commentedTried applying regression_login_form-2579779-11.patch. Error attached in the screenshot.
Comment #17
maris.abols commentedComment #18
cilefen commented#2578561: Move "Inline Form Errors" functionality to optional module and restore D7-style form errors by default removed the functionality we don't want.
Comment #19
maris.abols commentedComment #20
PeterE commentedI am not a fan of patches, so a simple solution for me was to copy the "status-messages.html.twig" template from the core Classy theme into my own theme. I then I added an id (status_message) to the div as follows:
<div data-drupal-messages id="status_message">Then in css I hid the status message as follows:
Comment #21
skaughtyou can also override what the messeage in the block says more directly for your project by putting.
in settings.php
Comment #22
skaughtremoved. flashback, double post.
Comment #25
benjifisherI am reopening this issue and marking #3179666: Inline Form Errors module advises that a failed login attempt with the wrong password is because of providing the wrong username. as a duplicate.
Even though the Inline Form Errors (IEF) module is disabled by default, it would be nice to solve the problem here even when IEF is enabled.
One suggestion from #3179666: Inline Form Errors module advises that a failed login attempt with the wrong password is because of providing the wrong username.:
We discussed these issues at #3186531: Drupal Usability Meeting 2020-12-11. We identified two problems with notifications that we might want to address, but not as part of this issue:
For this issue, we agreed that disabling IEF for the login form is a good step to take.
Comment #26
benjifisherComment #27
mrpauldriver commentedComment #31
smustgrave commentedClosing as cannot reproduce
In Drupal 9.5 when using a wrong username/password combo I get
Unrecognized username or password. Forgot your password? which seems pretty clear.
If this is still an issue please reopen maybe with an updated issue summary, screenshots, etc.
Thanks!
Comment #32
driskell commented@smusgrave
The Inline Form Errors core module needs to be enabled to reproduce. The fix recommended was to disable this modules functionality from applying to the login form so that even when the module is enabled you see the default messaging.
I’ll reopen.
Comment #33
smustgrave commentedThanks. Sounds like it will need an issue summary update to be more clear.
Comment #35
dmrupp commentedComment #36
dmrupp commentedI removed "Needs issue summary update" because I added the detail that the inline forms error module must be enabled to recreate this issue. This is still occuring on core 9.5.9.
Comment #38
mlncn commentedBumping this to major because the message:
> 1 error has been found: Username
occurs when people enter an incorrect password, also, and that stops most people from trying a different password or trying to reset their password.
Comment #39
mlncn commentedComment #42
welly commentedCan confirm patch at #11 resolves the described issue. Have rerolled for 11.x
Comment #43
welly commented(Removed "Needs reroll" tag)
Comment #44
welly commentedComment #45
smustgrave commentedSeems test coverage is lost
Comment #46
welly commentedCheers @smustgrave, will get that fixed 👍
Comment #48
oily commentedComment #49
oily commentedComment #50
oily commentedComment #51
oily commentedHave updated the IS. Applied the IS template.
Comment #52
oily commentedAdded stub functional test to the IFE module. Need to test the following scenarios: logins with bad username, bad password and bad username and password.
Assert that the status error message appears but that no IFE errors are output to the screen.