Validation errors for required paragraph subfields are incorrectly cleared

Created on 23 April 2025, 2 days ago

Problem​​:
When a content type references a paragraph entity with required subfields, submitting the form ​​without filling the required subfields​​ does NOT trigger validation errors as expected. The RequiredApiFormErrorHandler mistakenly clears these errors because it fails to parse nested field paths (e.g., field_content_section][1][subform][field_text][0][value).

​​Impact​​:

Required subfields in paragraphs can be left empty without validation.
Data integrity is compromised for entities relying on paragraph validation.
​​Steps to Reproduce​​
Install the Required API module.
Create a paragraph type Text Paragraph with a ​​required​​ text field field_text.
Create a content type Article with a paragraph reference field field_content_section (pointing to Text Paragraph).
Create an Article node:
Add a Text Paragraph to field_content_section.
​​Leave field_text empty​​.
Save the node.
​​Expected Result​​:
Validation error displays: "field_text field is required."

​​Actual Result​​:
Node saves successfully ​​without errors​​.

🐛 Bug report
Status

Active

Version

3.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