#limit_validation_errors related issues

Created on 5 January 2024, about 1 year ago
Updated 3 April 2024, 11 months ago

Problem/Motivation

#limit_validation_errors causes some issues in this module. For example, if the content type contains any 'select' field, we are getting an error when clicking on the Sidekick button.

```
TypeError: Drupal\Core\Field\WidgetBase::massageFormValues(): Argument #1 ($values) must be of type array, string given, called in /var/www/web/core/lib/Drupal/Core/Field/WidgetBase.php on line 386 in Drupal\Core\Field\WidgetBase->massageFormValues() (line 534 of /var/www/web/core/lib/Drupal/Core/Field/WidgetBase.php)
```

The problem originates from the Drupal core bug, which triggers under specific circumstances. Circumstances are:

- AJAX is used
- #limit_validation_errors is used
- $entity_form_display->extractFormValues( is used in AJAX callback

And that's exactly the case in the sidekick module. Some related issues are:

https://www.drupal.org/project/drupal/issues/3155438 🐛 #limit_validation_error reset form_state values in ajax request Active
https://www.drupal.org/project/commerce/issues/3136525

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024