Commit 75cae85f authored by jstoller's avatar jstoller Committed by Wolfgang Ziegler // fago
Browse files

Issue #1807460 by jstoller, ericduran, hass, John Pitcairn, TimLeytens: Field...

Issue #1807460 by jstoller, ericduran, hass, John Pitcairn, TimLeytens: Field collection doesn't play nice with workbench moderation (patch).
parent 3a2c562f
......@@ -921,6 +921,12 @@ function field_collection_field_insert($host_entity_type, $host_entity, $field,
* creation or to save changes to the host entity and its collections at once.
*/
function field_collection_field_update($host_entity_type, $host_entity, $field, $instance, $langcode, &$items) {
// Prevent workbench moderation from deleting field collections on node_save()
// during workbench_moderation_store(), when $host_entity->revision == 0.
if (!empty($host_entity->workbench_moderation['updating_live_revision'])) {
return;
}
$items_original = !empty($host_entity->original->{$field['field_name']}[$langcode]) ? $host_entity->original->{$field['field_name']}[$langcode] : array();
$original_by_id = array_flip(field_collection_field_item_to_ids($items_original));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment