Hi, I've got a problem with nested paragraphs (collapsed) not being validated before saving the parent node.

Steps to reproduce

  1. Create a custom paragraph (let's call it Advert) with Title field.
  2. Make Title field required.
  3. Create a custom paragraph (let's call it Adverts) with relation to Advert paragraph via Entity reference revisions field (let's call it Items).
  4. Add Adverts list field to Page node (or some custom bundle, it doesn't matter).
  5. Adverts list field has to be Entity reference revisions field with relation to Adverts paragraph.
  6. Select Paragraphs (stable) widget for Adverts list field.
  7. Go to /node/add/page and add some Advert paragraphs, but leave the Title fields empty.
  8. Click Collapse all button and save the page.

At this moment, page will be saved without validating required Title fields. Without collapsing all paragraphs or collapsing only a single paragraph - validation works as expected.

Does anyone else have this problem?

Issue fork paragraphs-3270166

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

tivi22 created an issue. See original summary.

gun_dose’s picture

Version: 8.x-1.13 » 8.x-1.15
Issue tags: +validation

I found the same issue. When paragraph contains nested paragraphs, I can collapse paragraph form by clicking on "Edit" button on the neighbor paragraph, in this case paragraph will be collapsed and nested paragraphs will be not validate. I can save them with empty fields that are reqired.

sense-design’s picture

Same problem here

thiagomoraesp’s picture

Same problem here, using a custom validation method on the form i noticed tha if they are collapsed the values don't even reach the form_state during validation/.

chrisac’s picture

Issue tags: +GreeceSprints2025
gun2dru’s picture

Hi team,
as a quick solution we can "expand" the paragraph that has violations. The fix relates to "Paragraphs (Stable)" widget.

gokul.jayan made their first commit to this issue’s fork.

gokul.jayan’s picture

Status: Active » Needs review