Inline form errors repeated on child elements

Created on 28 May 2024, 7 months ago

Problem/Motivation

The inline form errors are getting repeated on child elements. The repeated error messages are shown only if an error is set on the whole form element.

Steps to reproduce

1. Enable "inline_form_errors" and "block_content" core modules.
2. Enable the "inline_entity_form" contrib module.
3. Create a block type, add a text field.
4. To any node type, add an entity_reference field.
- Type of item to reference: "content_block".
- Reference type >> block type: select block type from step #3.
5. For the entity_reference field, use "Inline entity form - simple" widget on the managed form display page.
6. Trigger $form_state->setErrorByName on the entity_reference field.
7. You will find the form error message repeating for each inline form field.

Proposed resolution

The form error message should not be repeated for child elements.

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Form 

Last updated 2 days ago

Created by

🇮🇳India gaurav_manerkar Vasco Da Gama, Goa

Live updates comments and jobs are added and updated live.
  • Needs usability review

    Used to alert the usability topic maintainer(s) that an issue significantly affects (or has the potential to affect) the usability of Drupal, and their signoff is needed. When adding this tag, make it easy to review the issue. Make sure the issue summary describes the problem and the proposed solution. Screenshots usually help a lot! To get sign-off on issues with the "Needs usability review" tag, post about them in the #ux channel on Drupal Slack, and/or attend a UX meeting to demo the patch and get direct feedback from designers/UX folks/product management on next steps. If an issue represents a significant new feature, UI change, or change to the general "user experience" of Drupal, use Needs product manager review instead. See the scope of responsibilities for product managers.

  • Needs subsystem maintainer review

    It is used to alert the maintainer(s) of a particular core subsystem that an issue significantly impacts their subsystem, and their signoff is needed (see the governance policy draft for more information). Also, if you use this tag, make sure the issue component is set to the correct subsystem. If an issue significantly impacts more than one subsystem, use needs framework manager review instead.

  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

  • Needs screenshots

    The change alters the user interface, so before and after screenshots should be added to document the UI change. Make sure to capture the relevant region only. Use a tool such as Aviary on Windows or Skitch on Mac OS X.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024