Inline errors on price field are not visible

Created on 9 November 2023, about 1 year ago
Updated 17 November 2023, about 1 year ago

Describe your bug or feature request.

Back in 2018, some work was done to the price form element to aid in displaying inline form errors. Since the price element is a wrapper with a number and currency field (composite), I believe the general idea was to show the error on the parent, container level rather than on either child input.

In Drupal 10 on the development branch of Commerce, the inline form errors are no longer visible. You don't get the top level form-wide error message or the element message. It looks like this:

Seems like it would be ideal to revisit the steps taken back in 2018.

If a bug, provide steps to reproduce it from a clean install.

  1. Install a fresh copy of D10
  2. Install Commerce via composer
  3. Just enable the core and price modules.
  4. Enable inline form errors
  5. Create a custom form with the price element.
  6. Create a validation error on the price element

Here is a simple example module that replicates the issue: https://www.drupal.org/files/issues/2023-11-09/inline_price_validation_t...

NB: If you enable the store and product modules, the same behavior happens on the entity form for the product variation prices.

🐛 Bug report
Status

Fixed

Version

3.0

Component

Price

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