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

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

davis zhou created an issue. See original summary.

davis zhou’s picture

dieterholvoet made their first commit to this issue’s fork.

dieterholvoet’s picture

Status: Active » Needs review

@davis zhou thanks for your contribution! It fixes the issue for me. I just have one question, I left it in the MR.

dieterholvoet’s picture

  • dieterholvoet committed ff883789 on 3.0.x
    Issue #3520637 by dieterholvoet, davis zhou: Validation errors for...
dieterholvoet’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.