Problem/Motivation

Thumbnails have a width and height set to 0 in the media_field_data table. This is causing the thumbnail to not show up at all in the default media library list view.

Steps to reproduce

  1. Fresh Drupal site (I tested with 11.2.x)
  2. Install Media, Video Embed Field, and the Video Embed Field Media Integration modules.
  3. Create a Video Embed media bundle that uses this module's plugin
  4. Add a YouTube video
  5. Observe that the thumbnail doesn't display in the media library list view
  6. Inspect the media_field_data table and observe the thumbnail file reference is there but width and height are 0

Proposed resolution

I think this started happening after this core change in Drupal 10.1: #3088168: Media thumbnail dimensions are wrong for YouTube videos. The Media entity asks the source plugin to provide the width and height for the thumbnail. The Video Embed Field source plugin doesn't provide this metadata about its media, but it returns FALSE instead of NULL, which gets interpolated as the integer 0.

We just need to have getMetadata<code> return <code>NULL when it's asked to provide metadata it doesn't provide, like thumbnail size.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bkosborne created an issue. See original summary.

bkosborne’s picture

Status: Active » Needs review

Very confused about the merge request I opened which somehow has commit e87663c2 in it.