For fields like Field Collection that define an entity, support revisions via Entity API, and need to save their own entity when the host node is saved, there is no way to determine whether the host node is the default revision (published revision) at $entity->save() time without explicitly calling workbench_moderation_* functions.

This very simple two-line patch sets a $node->default_revision property, so an embedded revisionable entity calling entity_revision_is_default() on its host node gets the correct value, allowing it to determine how to save its entity revision.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

John Pitcairn’s picture

John Pitcairn’s picture

Status: Active » Needs review

Setting status

Where I'm going with this: support for Field Collections - see #1901892: Most recent Field Collection revision always appears in View when using Workbench Moderation

John Pitcairn’s picture

Status: Needs review » Closed (works as designed)

Nope, forget about this, don't need it. See the issue linked in #2.

dealancer’s picture

Issue summary: View changes