Login errors are displayed multiple times if the inline form error is enabled

Created on 16 December 2024, 4 months ago

When the inline for error is enabled, the 'Unrecognized email address or password. Forgot your password?' error is displayed multiple times on each form element.

Seems that the error is attached on $pane_form['returning_customer'] instead of $pane_form['returning_customer']['name']

I created a patch which fixes the issue

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇷🇴Romania cslevy

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

Merge Requests

Comments & Activities

  • Issue created by @cslevy
  • 🇩🇪Germany Anybody Porta Westfalica

    @cslevy makes sense to me, could you please create a MR from the patch so that @grevil can check this in detail? Thanks!

  • Assigned to Grevil
  • First commit to issue fork.
  • 🇩🇪Germany Grevil

    Unsure about this fix. The purpose of this error is to highlight the whole wrapper, instead of only the username, because the problem is either the username OR the password can be incorrect here and we don't want to let the user know which field is incorrect, to avoid brute force attacks.

    With:

    When the inline for[m] error is enabled, [...]

    you mean the drupal core "inline_form_errors" module? I would cautiously say, that it is unexpected behaviour, that this module recursively goes through all child elements of a wrapper and displays the same error for each?

    I'd say you create a core issue for this instead. I will set this to "works as designed" for now.

  • 🇩🇪Germany Grevil

    As a middle ground, we could also set the error on both the mail address and password field, as it currently also shows an error on the "Log in" button, which is understandably quite bad... But I still see the issue in "inline_form_errors" and not our side. Again I don't think implicitly setting form errors on form element children is an expected behaviour...

    What do you think @anybody?

    This is the current IS, when inline form errors are enabled:

    And this is the IS, when it is disabled (working as expected):

  • 🇩🇪Germany Anybody Porta Westfalica

    I agree, this needs clear steps for reproduction. You had the "Inline form errors" core module enabled @grevil?

  • 🇩🇪Germany Grevil

    I agree, this needs clear steps for reproduction.

    This is easily reproducible, as seen in the first screenshot of my comment #6. But as stated in my previous comments, I don't think that the current implementation is incorrect, nor is it an issue on our behalf.

Production build 0.71.5 2024