Make oEmbed thumbnail dimensions more permissive

Created on 31 October 2023, 10 months ago

Problem/Motivation

When an oEmbed provider returns a thumbnailWidth and/or thumbnailWidth that is NULL, setThumbnailDimensions() throws an error, since it requires the width and height to be integers that are larger than 0. This is a similar issue as #3071682: The oembed Resource value object should be more permissive for NULL dimensions β†’ .

Steps to reproduce

- Create a media bundle that supports e.g., Infogram (I ran into this issue using this provider). To do so, create a provider bucket with Infogram enabled using the https://www.drupal.org/project/oembed_providers β†’ module.
- Add a media entity at /media/add. Choose the newly added media bundle. Use e.g., https://infogram.com/live-calgary-election-oct-7-1gl8m37ex6y7p36 as oEmbed URL.

Proposed resolution

The same solution that was used in #3071682: The oembed Resource value object should be more permissive for NULL dimensions β†’ seems to work for this issue. See patch.

Remaining tasks

Write/refactor existing test.

User interface changes

None.

API changes

\Drupal\media\OEmbed\Resource::setThumbnailDimensions accepts argument that are either int or null, instead of only int values.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
MediaΒ  β†’

Last updated less than a minute ago

Created by

πŸ‡¨πŸ‡¦Canada brunodbo Coast Salish Territory

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

Comments & Activities

Production build 0.71.5 2024