Problem/Motivation

The module throws a fatal error when using the “Thumbnail” display formatter with the HTML5 provider enabled.

Environment

  • PHP: 8.4
  • Drupal: 11.3.8

Error:

The website encountered an unexpected error. Try again later.

Error: Call to a member function getPath() on null in Drupal\video_embed_html5\Plugin\video_embed_field\Provider\Html5->renderThumbnail() (line 146 of modules/contrib/video_embed_html5/src/Plugin/video_embed_field/Provider/Html5.php).

Drupal\video_embed_field\Plugin\Field\FieldFormatter\Thumbnail->viewElements() (Line: 114)
Drupal\video_embed_field\Plugin\Field\FieldFormatter\Colorbox->viewElements() (Line: 91)
Drupal\Core\Field\FormatterBase->view() (Line: 275)
Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple() (Line: 341)
Drupal\Core\Entity\EntityViewBuilder->buildComponents() (Line: 29)
Drupal\node\NodeViewBuilder->buildComponents() (Line: 283)
Drupal\Core\Entity\EntityViewBuilder->buildMultiple() (Line: 240)
Drupal\Core\Entity\EntityViewBuilder->build()
call_user_func_array() (Line: 107)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 910)
Drupal\Core\Render\Renderer->doCallback() (Line: 441)
Drupal\Core\Render\Renderer->doRender() (Line: 230)
Drupal\Core\Render\Renderer->render() (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->{closure:Drupal\Core\Render\MainContent\HtmlRenderer::prepare():235}()
Drupal\Core\Render\Renderer::{closure:Drupal\Core\Render\Renderer::executeInRenderContext():634}()
Fiber->start() (Line: 635)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 131)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray() (Line: 246)
Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (Line: 56)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (Line: 188)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 118)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 92)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 53)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 54)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 745)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

  1. Enable the module.
  2. Add a video embed field on a content type (with the HTML5 provider enabled).
  3. Set display to thumbnail.
  4. Open the node.
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

witcher_ created an issue. See original summary.

witcher_’s picture

Status: Active » Needs review
witcher_’s picture

Assigned: witcher_ » Unassigned
fizcs3’s picture

As per related issue 3586918, having the same issue and MR!12 fixes it for me.
I am on Drupal 10.6.7, PHP 8.4, video_embed_html5 2.0.3
Thank you @witcher_