Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This notice shows when the module tries to update an image that has no original image dimensions saved:
Notice: Undefined property: stdClass::$image_dimensions in file_entity_file_update() (Line 90 of ***/www/sites/all/modules/file_entity/file_entity.file.inc).
Line 90 of file_entity.file.inc:
90 if ( $file->image_dimensions != $file->original->image_dimensions ) {
91 _file_entity_update_image_field_dimensions($file);
92 }
This fixes the notice:
if (
isset($file->image_dimensions) &&
isset($file->original->image_dimensions) &&
$file->image_dimensions != $file->original->image_dimensions
){
_file_entity_update_image_field_dimensions($file);
}
Comments
Comment #1
Dave ReidI believe this has been fixed since the image dimensions table is no more and was converted to metadata. Does this still need to be fixed with the metadata API?
Comment #2
artfulrobot CreditAttribution: artfulrobot commentedI'm seeing a similar error when uploading an image file to a file field using entity_metadata_wrapper on a node that previously had an empty file field.
Notice: Undefined property: stdClass::$image_dimensions in file_entity_file_update() (line 63 of ...sites/all/modules/file_entity/file_entity.file.inc).
The following patch fixes it:
Comment #3
Dave ReidI think this would be resolved by #2211937: Image dimensions not updated on image replacement