Commit 41704f82 authored by Liam Morland's avatar Liam Morland
Browse files

Make Field Collection work with Workbench Moderation.

https://drupal.org/node/1807460#comment-6577270
parent 17d945ff
......@@ -935,6 +935,12 @@ function field_collection_field_presave($host_entity_type, $host_entity, $field,
* Care about removed field collection items.
*/
function field_collection_field_update($entity_type, $entity, $field, $instance, $langcode, &$items) {
// Prevent workbench moderation from messing up our field_collection
if (!empty($entity->workbench_moderation['updating_live_revision'])) {
return;
}
$items_original = !empty($entity->original->{$field['field_name']}[$langcode]) ? $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