- Issue created by @joshahubbers
- Merge request !7Issue #3485050 by joshahubbers: Error when no media item found β (Closed) created by joshahubbers
- πΊπΈUnited States scott_earnest
Hi and thank you for catching this. Maybe there was a referenced entity that was removed? I was able to duplicate the issue by zero-ing out the "target_id" so that it would not load the media or thumbnail correctly:
// Load the media for the thumbnail, if it's media reference. else { + $target_id = 0; $thumbnail_media = $this->entityTypeManager->getStorage('media')->load($target_id);
Regarding your patch, I feel that the thumbnail_file_id needed to be set either way, even if to false, but further down needed some checks.
I have pushed a fix to the 1.x-dev branch.
Testing Instructions
- Use the MVM formatter with "Custom Thumbnail Media Reference" display
- Use the code block above to manually alter the target id
- Verify the page still loads, but the MVM item would not display since the thumbnail did not exist - 8e71e902 committed on 1.x
Issue #3485050 by joshahubbers, scott_earnest: Error when no media item...
- 8e71e902 committed on 1.x