Is it nonsensical to say something does not make sense yet is redundant to something else? Maybe.
You get this bizarre "1 error has been found: username" warning when you fail to log in to D8. This is regardless of whether the username was wrong, or the password, or both. It is in addition to the "real" error message that appears below the field. This doesn't look very polished:
For reference, this is what D7 does:
Edit -Adding so hopefully Inline Form Errors can be disabled for the login form:
The Inline Form Errors core module needs to be enabled to reproduce.
Usability meeting determined that skipping the behavior of the Inline Form Errors module for the login form is a good first step.
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 CreditAttribution: cilefen commentedComment #3
cilefen CreditAttribution: cilefen commentedComment #4
cilefen CreditAttribution: cilefen commentedComment #6
cilefen CreditAttribution: 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 CreditAttribution: cilefen commentedI added the Novice tag because a novice can do the following:
These could be converted to ->assertNoRaw.
Comment #11
sdstyles CreditAttribution: sdstyles at FFW commentedComment #12
cilefen CreditAttribution: 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 CreditAttribution: Bojhan as a volunteer commentedWhy do we remove the drupal set message, are we special casing this one message?
Comment #14
cilefen CreditAttribution: cilefen commentedYes.
Comment #15
j2r CreditAttribution: 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 CreditAttribution: shwetaneelsharma at Axelerant commentedTried applying regression_login_form-2579779-11.patch. Error attached in the screenshot.
Comment #17
maris.abols CreditAttribution: maris.abols commentedComment #18
cilefen CreditAttribution: 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 CreditAttribution: maris.abols commentedComment #20
PeterE CreditAttribution: PeterE as a volunteer 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 CreditAttribution: MrPaulDriver commentedComment #31
smustgrave CreditAttribution: smustgrave at Mobomo 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 CreditAttribution: Driskell at Other Media 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 CreditAttribution: smustgrave at Mobomo commentedThanks. Sounds like it will need an issue summary update to be more clear.
Comment #35
DMRupp CreditAttribution: DMRupp commentedComment #36
DMRupp CreditAttribution: DMRupp as a volunteer 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 CreditAttribution: mlncn at Agaric for MASS Design Group, Drutopia 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 CreditAttribution: mlncn at Agaric for MASS Design Group, Drutopia commentedComment #42
welly CreditAttribution: welly at manifesto commentedCan confirm patch at #11 resolves the described issue. Have rerolled for 11.x
Comment #43
welly CreditAttribution: welly at manifesto commented(Removed "Needs reroll" tag)
Comment #44
welly CreditAttribution: welly at manifesto commentedComment #45
smustgrave CreditAttribution: smustgrave at Mobomo commentedSeems test coverage is lost
Comment #46
welly CreditAttribution: welly at manifesto commentedCheers @smustgrave, will get that fixed 👍