diff --git a/modules/file/file.field.inc b/modules/file/file.field.inc index b26d7e4..794f16e 100644 --- a/modules/file/file.field.inc +++ b/modules/file/file.field.inc @@ -252,6 +252,12 @@ function file_field_insert($entity_type, $entity, $field, $instance, $langcode, * Checks for files that have been removed from the object. */ function file_field_update($entity_type, $entity, $field, $instance, $langcode, &$items) { + // Check whether the field is defined on the object. + if (!isset($entity->{$field['field_name']})) { + // We cannot check for removed files if the field is not defined. + return; + } + list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity); // On new revisions, all files are considered to be a new usage and no