As shown in the screenshots, I have a field called CTA Paragraph in my brick that references to a paragraph I had created(reusable paragraph used in other bricks too). Now while editing the brick if I click on Save & keep Published directly then the paragraph & all the other fields get saved correctly.

But if I click on Update Brick and then click on Save & keep Published it removes all values present in the Paragraph field.

NOTE: I added the patch from Prevent undefined index in bricks_preprocess_paragraph() it removed this notice but only saves partially.

Test Case 1: If no nothing is changed in the paragraph field the value remains even after clicking update brick & then save. (Works)

Test Case 2: If the added paragraph has multiple fields within it like my case(attached Screen Shot 2017-05-24 at 4.08.50 PM.png) then after adding this patch only the field which was changed within the paragraph is saved all the other fields in the paragraph becomes blank. Eg: Say my paragraph has 3 fields and I edited field_1 then field_1 is saved but field_2 & field_3 which had value initially gets empty. (Fails)

I am new to drupal (less than 2 months) therefore any suggestion or solution would be appreciated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chris64uz created an issue. See original summary.

chris64uz’s picture

Title: Paragraph Field not saved in Brick. » Paragraph Field not saved in Brick (Update Brick is clicked).
chris64uz’s picture

Issue summary: View changes
chris64uz’s picture

Issue summary: View changes
FileSize
60.12 KB
chris64uz’s picture

Issue summary: View changes
anydigital’s picture

Thanks Christopher for reporting.

It looks like the initial issue is from #2367235: Support entity revision references. Please try the patch from #2367235-92: Support entity revision references and let me know if it helps.

anydigital’s picture

Status: Active » Postponed (maintainer needs more info)
chris64uz’s picture

I tried the #2367235: Support entity revision references partially but it started breaking a few other things therefore I decided to abandon this approach in fear of delaying my project. Instead I found a workaround I created a Brick with the fields from Paragraph & took the Brick within Brick approach. This worked without any issues.

I am going to stick with this approach and avoid mixing Paragraphs & Bricks until bricks & paragraphs become compatible with each other in future.

Thanks @tonystar for the quick reply.

anydigital’s picture

anydigital’s picture

Updates from Slack:

murrayw [12:03 AM]
Hi there everyone. We've run into a bit of a problem with bricks, paragraphs, the inline entity form and entity revisions (https://www.drupal.org/project/bricks/issues/2881274) where the last comment was June 2017. It appears that it is an issue with Inline Entity Form (https://www.drupal.org/node/2367235). That issue has a patch #92 which we will try soon. Some success has been reported when not using Paragraphs. Also, the ECK Bricks within Bricks approach has been reported to work. I am wondering what the state of play is here and if anyone has any advice for us. This is a bit of a showstopper at the moment and we may need to rethink our current approach. Any advice?

murrayw [1:04 AM]
For the record, https://www.drupal.org/project/inline_entity_form/issues/2367235#comment... did work for us.

tonystar [6:55 PM]
Regarding Bricks + Revisions - you are completely right: we are waiting for Inline Entity Form support for revisions. Also- I’m working now on native Paragraphs widget support - so it could be possible to switch from IEF to Paragraphs widget, which supports revisions by design!