Inline Form Validation errors could be improved

Created on 10 November 2023, about 1 year ago

Problem/Motivation

When the inline form errors module is enabled and a name field is completely empty, the resulting error messages are overly generic and messages are shown for hidden components. Here is what it looks like:

It would be great if just the required, visible components received error messages. It would also be great if those messages were contextual to the component in error.

Steps to reproduce

  1. Create a fresh D10 install.
  2. Composer require and enable the dev branch of the name module.
  3. Enable the inline form errors module.
  4. Create an entity with a name field or add a name form element to any form. Make sure at least one component is required.
  5. Submit the empty form.

In case it helps, here is a module that illustrates the scenario: https://www.drupal.org/files/issues/2023-11-10/inline_name_validation_te... β†’

Proposed resolution

Update the name_element_validate function in name.module to provide a different validation strategy when inline form errors is enabled.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States lkacenja

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

Comments & Activities

Production build 0.71.5 2024