diff --git a/field_collection.entity.inc b/field_collection.entity.inc index c23de22..f5f443c 100644 --- a/field_collection.entity.inc +++ b/field_collection.entity.inc @@ -232,7 +232,15 @@ class FieldCollectionItemEntity extends Entity { list($recieved_id) = entity_extract_ids($this->hostEntityType, $entity); if ($this->isInUse()) { - $current_id = $this->hostEntityId; + if (is_array($this->hostEntityId)) { + $current_id = in_array( + $recieved_id, + $this->hostEntityId + ) ? $recieved_id : FALSE; + } + else { + $current_id = $this->hostEntityId; + } } else { $current_host = entity_revision_load($this->hostEntityType, $this->hostEntityRevisionId); @@ -315,7 +323,7 @@ class FieldCollectionItemEntity extends Entity { if ($this->isInUse()) { $data_array_keys = array_keys($data); - $this->hostEntityId = $data ? end($data_array_keys) : FALSE; + $this->hostEntityId = $data ? $data_array_keys : FALSE; $this->hostEntityRevisionId = FALSE; } // If we are querying for revisions, we get the revision ID.