After update from 1.2 to 1.5 the oembed video thumbnails are broken.

I prepared a quick patch that fixes the issue, but maybe you can find a more elegant solution.

Comments

nortmas created an issue. See original summary.

socialnicheguru’s picture

Status: Active » Needs review
ndewhurst’s picture

Title: After update from 1.2 to 1.5 the oembed video thumbnails are broken. » After update from 1.2 to 1.5, thumbnails are broken for oembed video and other media types
StatusFileSize
new2.26 KB

Hi, I maintain the Brandfolder module, which provides a media source plugin for images that are ultimately stored in that external DAM. Drupal media entities using that source do have an image field and a media thumbnail (which are effectively identical, such that the thumbnail alt & title attributes can be updated and translated). However, the "source field" for those media entities is not an image field, so the latest version of this module is not working with those media types. This is the same situation as for oembed and other media sources.
Here is a patch that flips the logic a bit and says "try to use the media entity's source field if this is a standard image-sourced media item; otherwise, use the thumbnail."

djdevin’s picture

Status: Needs review » Reviewed & tested by the community

Had the same issue with Bynder, probably functions the same way.

Patch fixes the issue.

djdevin’s picture

Version: 8.x-1.5 » 8.x-1.x-dev
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.8 KB

This works but when using Bynder (or another media provider) the alt text is lost because $source_field isn't an image.

This is not the fault of the patch as it was missing before. But I changed the patch around so that it would find the first image field on the media.

Not sure if this is the best approach but it does fix the alt text. Responsive thumbnails still seem to work.

fmb’s picture

This looks like #3462392: Error when used on "Remote video" media, which has been more active recently. Should we mark this issue as duplicate?