OEmbed fails to save if thumbnail fails to download

Created on 7 January 2023, almost 2 years ago
Updated 11 September 2024, 2 months ago

Problem/Motivation

When implementing the Streamable OEmbed, the thumbnail URL is provided, but Drupal throws a Failed to open stream: No such file or directory error for the file_get_contents() function. This leads to a situation where the thumbnail URL is set, but its height & width cannot be determined, which breaks the flow.

Steps to reproduce

  1. Implement the Streamable OEmbed provider (I used the OEmbed Providers β†’ module)
  2. Create a new media type with this provider.
  3. Attempt to add a streamable URL (such as https://streamable.com/pt3eor) as a new media item.
  4. See the Failed to open stream: No such file or directory warning thrown, and the additional The thumbnail dimensions must be numbers greater than zero. error in the logs.

Proposed resolution

Add an additional check that the URL can be retrieved before getting the thumbnail dimensions.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
MediaΒ  β†’

Last updated about 10 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States oo0shiny

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024