Problem/Motivation

In order for Workbench Moderation to save a forward revision (i.e. a draft revision newer than the published revision), it must trigger node_save() twice—first to save the new revision and then again to set the node table entry back to the previously published revision. The second save requires that $entity->revision be set to 0, so yet another revision isn't created. Unfortunately, this triggers paragraph_field_update() to delete paragraph revisions.

Proposed resolution

The attached patch checks to see if $entity->workbench_moderation['updating_live_revision'] has been set and, if so, it skips the rest of the function. This is identical to the patch that was committed to Field Collection to solve the same problem.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Original report by @jstoller

Is Paragraphs being developed with revision support in mind? More specifically, is compatibility with content moderation modules, like Workbench Moderation, a goal of this module? I ask because Field Collections has had some issues with this in the past and I understand this module is heavily based on that one.

I'm hoping to use Paragraphs on a very large site (and several smaller ones), but content moderation is a must-have feature for us.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jeroen.b’s picture

Paragraphs has revision support. It does not have content moderation support per paragraph item, but it will work fine with Workbench Moderation.

jstoller’s picture

That's fabulous! I actually think per bundle content moderation on paragraphs seems like overkill and a little counter productive, but node based moderation is a necessity.

jstoller’s picture

Title: Revision and content moderation support » Paragraphs doesn't play nice with Workbench Moderation
Category: Support request » Bug report
Priority: Normal » Major
Issue summary: View changes
Status: Active » Needs review
Related issues: +#1807460: Field collection doesn't play nice with workbench moderation (patch)
FileSize
849 bytes

Changed to bug report, added related issue and uploaded patch.

  • Commit 4fb82ed on 7.x-1.x by jeroen.b:
    Fixes #2244789, checks for Workbench Moderation, so we won't delete the...
jeroen.b’s picture

Pushed, I'll push out a new version soon after I checked #2138767.

jstoller’s picture

Status: Needs review » Closed (fixed)

Thanks for committing it so quickly! I'll mark this one fixed.