diff --git a/field_collection.module b/field_collection.module index 2409b4f..21be6fe 100644 --- a/field_collection.module +++ b/field_collection.module @@ -897,7 +897,7 @@ function field_collection_field_settings_form($field, $instance) { function field_collection_field_presave($host_entity_type, $host_entity, $field, $instance, $langcode, &$items) { $force_new_entity = !empty($host_entity->is_new); // Some special casing for nodes since is_new property is being set after this - // hook fires. Usually the is_new property/flag should be set before calling + // hook fires. Usually the is_new property/flag should be set before calling // field_attach_presave(). if (!$force_new_entity && $host_entity_type == 'node') { $force_new_entity = empty($host_entity->nid); @@ -915,6 +915,9 @@ function field_collection_field_presave($host_entity_type, $host_entity, $field, $entity->item_id = NULL; $entity->revision_id = NULL; $entity->is_new = TRUE; + } + + if (!empty($entity->is_new)) { $entity->setHostEntity($host_entity_type, $host_entity, LANGUAGE_NONE, FALSE); }