list-group component is not compatible with inline_form_errors module

Created on 21 July 2024, 4 months ago
Updated 10 September 2024, 2 months ago

Problem/Motivation

inline_form_errors module is part of Drupal 10.x core. It allows us to have form validation errors displayed in the Bootstrap custom style. However, the current radix list-group component implementation isn't compatible with the summary of the form elements containing invalid values (provided by inline_form_errors), which is printed either at the top of the content region or at the top of the form itself (when the AJAX form submission is used.

After submission of form containing invalid values, following exception is logged:

Drupal\sdc\Exception\InvalidComponentException: [list_group_items[0].value] Object value found, but a string is required/n[list_group_items[1].value] Object value found, but a string is required/n[list_group_items[2].value] Object value found, but a string is required in Drupal\sdc\Component\ComponentValidator->validateProps() (line 205 of /app/web/core/modules/sdc/src/Component/ComponentValidator.php).

Steps to reproduce

  • install current version of the webform module
  • create a webform containing a required form element
  • display the webform using the sub-theme of radix
  • submit the webform without filling-in the required element

Proposed resolution

Accept both string and object as value of list_group_items[n].value

๐Ÿ› Bug report
Status

Fixed

Version

6.0

Component

Code

Created by

๐Ÿ‡จ๐Ÿ‡ฟCzech Republic milos.kroulik

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024