User warning: Missing file with ID

Created on 22 May 2018, over 6 years ago
Updated 18 December 2023, 11 months ago

***** UPDATED *****

I'm having an issue with an Image field that I've set up under a Media Type. I'm able to create nodes, upload images or select images from the media browser just fine, but if I need to edit the node and change the photo, when I save it I get the following warning and my image disappears:

User warning: Missing file with ID image/jpeg. in Drupal\image\Plugin\Field\FieldType\ImageItem->preSave() (line 327 of core/modules/image/src/Plugin/Field/FieldType/ImageItem.php).

The only way I seem to get it working again is to completely delete the node and recreate a new one.

I have other fields set up the same way with normal content types and it works fine.

I'm using:
Drupal 8.5.3
Entity Browser 8.x - 1.4
dropzonejs 8.x-2.0-alpha3

Please let me know if this should get posted elsewhere, thanks a million for any help.

πŸ› Bug report
Status

Active

Version

1.4

Component

Field widget

Created by

πŸ‡ΊπŸ‡ΈUnited States beezer75

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡΅πŸ‡°Pakistan Mansoor Aziz

    i have the same issue as this is my error:

    User warning: Missing file with ID 150. in Drupal\image\Plugin\Field\FieldType\ImageItem->preSave() (line 331 of core/modules/image/src/Plugin/Field/FieldType/ImageItem.php).
    

    And here is it solution:

    • Just jump to your DB phpmyadmin:
    • Open all the image tables inside database
    • Search for missing file ID, In my case it's 150.
    • When you find out the file id in the database there will be the entity id mentioned in front of it (i have attached the screenshot).
    • So, From here just visit this entity id and update or remove the image

    Hope this help and error will be fixed.

Production build 0.71.5 2024