I have a node with Paragraph Entity field, where I can add multiple paragraphs.
When I select first paragraph It is expanded and if I do not fill required fields and try to save, warring does not allow me to save the node. That is great.
But when I do not fill required field and add second paragraph, the first one paragraphs is shrank and its fields are collapsed. If I fill the second paragraph correctly and try to save, the operation is successful and required field in paragraph one is saved with empty value.
This is a big problem and I think first paragraph should be validated when try to add second.

Comments

NikolaAt created an issue. See original summary.

supriya1992’s picture

Assigned: Unassigned » supriya1992
supriya1992’s picture

StatusFileSize
new126.98 KB

Hi,

I have checked the scenario that you mentioned above. The solution for this problem is as follows:
1. First create a paragraph types and make the fields required as per your requirements.
2. Now use it where you want, for example use in a content type xyz.
Now if you "add more" paragraphs it will not collapsed and not to allow save if you does not fill the required filed. Don't make only content type filed required, you should make the paragraph type fields required as your requirements.

If you will click on collapse without filling values in required filed it will throw errors and will not collapsed until you fill values in required fields.

Please check the attachment.

supriya1992’s picture

Status: Active » Needs review
supriya1992’s picture

StatusFileSize
new141.52 KB
Webbeh’s picture

Assigned: supriya1992 » Unassigned
Status: Needs review » Closed (duplicate)

This issue is a duplicate of https://www.drupal.org/project/paragraphs/issues/2612120 , closing pending any separate thoughts on the matter.

nikolaat’s picture

Status: Closed (duplicate) » Needs review

Webbeh the issue you mentioned is for D7. We are D8.

Webbeh’s picture

Oh lord, good eyes NikolaAt. Apologies!

Linked the D7 version of this issue as a related issue so hopefully they can be paired together.

nikolaat’s picture

Title: Required fields not validated, when paragraph is not collapsed. » Collapsed paragraphs does not validate required fields.
Issue summary: View changes
supriya1992’s picture

Webbeh’s picture

Status: Needs review » Needs work

But when I do not fill required field and add second paragraph, the first one paragraphs is shrank and its fields are collapsed. If I fill the second paragraph correctly and try to save, the operation is successful and required field in paragraph one is saved with empty value.

NikolaAt, can you provide more information on the configuration that allowed this functionality to happen?

I'm trying to reproduce and confirm this bug using the latest Paragraphs release (using either the Experimental or Classic form display modes), but I am currently unable to recreate the first paragraph entity being collapsed when creating the second entity on the Classic form display mode.

However, each of the configurations I'm working with give me correct functionality, where the empty Paragraph entity is being flagged on Save.

Webbeh’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#3041810: Field validation for all fields in paragraph can be bypassed

Actually, scratch that: following https://www.drupal.org/project/paragraphs/issues/3041810 , I was able to reproduce this issue, although your comment on that issue appears to mirror the original issue (and mirrors the original post in this issue).

Closing this in lieu of the older, more detailed issue handling this bug, unless there's some justification for this issue to remain open.