Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Similar to Field Collections, Stacks and vanilla ECK entities using Entity Reference, it seems that Bricks suffers from the critical mistake of not supporting revisions on the parent entity, thus any changes made to the brick objects are immediately made public. This means that Content Moderation or other editorial workflow system would be broken when using Bricks.
To resolve this, rewrite the module to build off Entity Reference Revisions instead of Entity Reference.
Comment | File | Size | Author |
---|---|---|---|
#10 | Screen Shot 2017-04-11 at 10.08.12 AM.png | 75.83 KB | pavlosdan |
Comments
Comment #2
DamienMcKennaComment #3
DamienMcKennaComment #4
anydigital CreditAttribution: anydigital as a volunteer and at Highweb commentedYour truth Damien!
I tried to implement this, but I'm rather new to 8.x fields/widgets/formatters world. Can you please advise on pros & cons for the following options?
1. Extend right from EntityReferenceRevisionsItem instead EntityReferenceItem. => But IEF can be broken, right?
2. Custom support by storing target_revision_id per each item (I already have serialized `options` column).
3. Do not extend at all, use EntityReferenceRevisionsItem as is. But I need to add several db columns somehow.
Looking forward for your thoughts!
Comment #5
anydigital CreditAttribution: anydigital as a volunteer and at Highweb commentedAnother related issues for custom Brick entities powered by ECK - https://www.drupal.org/node/2788507.
But we can still work on support for revisions on widget side (Bricks can work with any entity types, ie nodes).
Comment #6
DamienMcKennaI don't have any advice on how to approach using Entity Reference Revisions instead of Entity Reference, you should check with the Paragraphs maintainers on that.
Comment #8
anydigital CreditAttribution: anydigital as a volunteer and at Highweb commentedAvailable as a core submodule (Bricks Revisions) starting from 8.x-1.3!
Comment #9
caldenjacobs CreditAttribution: caldenjacobs commentedBravo, @tonystar! :)
Comment #10
pavlosdan CreditAttribution: pavlosdan commentedAfter enabling the Bricks Revisions module and rebuilding the cach there's 2 "Paragraphs" options showing under Reference Revisions when adding a new field to a node. One is seemingly provided by Bricks according to the HTML of the element. Please refer to attached screenshot. Possible conflict with Paragraphs if that module is also installed on the site? (though admittedly someone using Bricks might not be using Paragraphs as well as they seem to satisfy the same need). Thought I'd give a heads up anyway.
Comment #11
pavlosdan CreditAttribution: pavlosdan commentedSeems that this is not an issue with Bricks but an issue with Paragraphs as they do not seem to provide their own FieldType extending EntityReferenceRevisionsItem and instead are treating all entity reference revision field types as possible field types to be used with Paragraphs. (from what I understood from my digging around the Bricks and Paragraphs code and this postponed issue: https://www.drupal.org/node/2430209).
Comment #12
anydigital CreditAttribution: anydigital as a volunteer and at Highweb commentedThanks Pavlos for reporting!
No conflicts. Bricks field type and widget are designed to be compatible with ANY entity, and since Paragraph is just entity - they work well together.
Thanks for pointing! It's not a bug actually, Bricks is one field type and generic Entity Reference Revisions is another one => that's why you see two options labeled "Paragraph" - the same target (Paragraph) but different field types.
Comment #13
pavlosdan CreditAttribution: pavlosdan commentedI see. thanks a lot for explaining Tony! much appreciated :)
Comment #14
anydigital CreditAttribution: anydigital as a volunteer and at Highweb commentedYou are welcome!
Also you can always ask/report in Slack: https://drupalslack.herokuapp.com, channel: #bricks or direct message: @tonystar!
Comment #15
Mohammed J. RazemIt seems that when creating a new field of type "Bricks (revisioned)" the Brick bundle is not available for "Type of item to reference".
However, Paragraph, Content, Media, Custom block are available.
Is this a limitation from ECK? Or am I missing something?
Comment #16
anydigital CreditAttribution: anydigital as a volunteer and at Highweb commentedMohammed, correct-
ECK revisions support is in progress: https://www.drupal.org/node/2788507.
Comment #18
ashish.ietecs CreditAttribution: ashish.ietecs commentedWe need to implement revision support using brick and eck. We are using brick , eck , inline entity form, entity reference revision, and brick revision as a field of type. Initially when we used, it didn't work for us. Whenever we update any brick bundle inside brick content then immediately referenced brick bundle get published with latest revision. After searching on web we have applied below patches in -
For eck revision support -
https://www.drupal.org/node/2788507 -
For inline entity reference revision support -
https://www.drupal.org/node/2367235 -
Now after applying above patches, revisions of referenced brick bundle is maintained with only entity reference revision field widget, but not with brick revision field. By using brick revision field, it always update with latest revision of referenced brick bundle to parent entity. We have to use brick revision field for the legacy purpose. Any one has encounter in this situation and applied any solution can please help me out. This is a blocker situation for us. Please help us.
Comment #19
DamienMcKenna@ashish.ietecs: You should open a new "support request" issue to cover this request, as this issue is closed most people won't see it.