Commit 7f103a30 authored by joegraduate's avatar joegraduate Committed by Renato Gonçalves H
Browse files

Issue #3029628 by joegraduate, azslay, RenatoG: Re-apply fix from #1866032...

Issue #3029628 by joegraduate, azslay, RenatoG: Re-apply fix from #1866032 (EntityFieldQueryException: Unknown field)
parent dd273902
......@@ -626,8 +626,9 @@ function field_collection_field_update($host_entity_type, $host_entity, $field,
* Implements hook_field_delete().
*/
function field_collection_field_delete($entity_type, $entity, $field, $instance, $langcode, &$items) {
$ids = field_collection_field_item_to_ids($items);
// Also delete all embedded entities.
if ($ids = field_collection_field_item_to_ids($items)) {
if ($ids && field_info_field($field['field_name'])) {
// We filter out entities that are still being referenced by other
// host-entities. This should never be the case, but it might happened e.g.
// when modules cloned a node without knowing about field-collection.
......
Supports Markdown
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