- Issue created by @cgmonroe
- 🇮🇳India divyansh.gupta Jaipur
I’ve been trying to reproduce this issue but wasn't able to.
Here’s what I did:- Created a media item (video) with a thumbnail.
- Manually set the thumbnail__target_id field to NULL directly in the database.
- Cleared the cache and then tried editing and deleting that media item — everything worked fine, no errors showed up.
- So far, I haven’t been able to trigger the error (InvalidArgumentException: Field is unknown). Maybe this has already been fixed in recent updates, or I might be missing a specific step.
If anyone has more detailed steps to reproduce this issue, I’d really appreciate it!
Thanks! - 🇺🇸United States cgmonroe
Hmm wondering if it might be version related?
My environment:
Drupal version : 10.5.1
DB driver : mysql
PHP OS : Linux
PHP version : 8.2.27Here's what the devel tab shows about the media's thumbnail that fails:
- Merge request !14Issue#3537479: Fix the error to load file with null id. → (Open) created by divyansh.gupta
- 🇮🇳India divyansh.gupta Jaipur
I’ve uploaded a merge request for review.
The MR adds a safeguard to avoid calling load(NULL) when $fid is not set.
While I couldn’t reproduce the issue locally, the patch avoids a fatal error in such cases without introducing side effects.
Please review!!