The Gif Player Video field doesn't work

Created on 10 April 2025, 5 days ago

Problem/Motivation

When I try to use the Gif Player Video field in my content type and I add a video (mp4 file) and try to display the node, I get a WSOD:

The website encountered an unexpected error. Try again later.

Error: Object of class Drupal\Core\Config\ImmutableConfig could not be converted to string in Drupal\Core\Entity\EntityStorageBase->buildCacheId() (line 142 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).
Drupal\Core\Entity\EntityStorageBase->getFromStaticCache() (Line: 282)
Drupal\Core\Entity\EntityStorageBase->loadMultiple() (Line: 262)
Drupal\Core\Entity\EntityStorageBase->load() (Line: 78)
Drupal\gifplayer\Plugin\Field\FieldFormatter\GifPlayerVideoFormatter->viewElements() (Line: 91)
Drupal\Core\Field\FormatterBase->view() (Line: 83)
Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase->view() (Line: 275)
Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple() (Line: 286)
Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple() (Line: 340)
Drupal\Core\Entity\EntityViewBuilder->buildComponents() (Line: 24)
Drupal\node\NodeViewBuilder->buildComponents() (Line: 282)
Drupal\Core\Entity\EntityViewBuilder->buildMultiple() (Line: 239)
Drupal\Core\Entity\EntityViewBuilder->build()
call_user_func_array() (Line: 107)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 825)
Drupal\Core\Render\Renderer->doCallback() (Line: 387)
Drupal\Core\Render\Renderer->doRender() (Line: 203)
Drupal\Core\Render\Renderer->render() (Line: 238)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 593)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 231)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 128)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray() (Line: 246)
Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}() (Line: 206)
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: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 709)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

Go to Home Administration > Structure > Content types > Your Content Type > Manage fields , select "File Upload" , select "Gif Player Video" and save, then create a "Your Content Type" node, add a video and try to open the new node, you'll see the error above

Proposed resolution

Need to fire up XDebug and try to catch the error, then create a MR.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇨🇦Canada danrod Ottawa

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

Merge Requests

Comments & Activities

  • Issue created by @danrod
  • 🇨🇦Canada danrod Ottawa

    Looking at the logs, I also see this error:

    <strong>Warning: array_flip(): Can only flip string and integer values, entry skipped in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 278 of /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php)</strong>
    
    #0 /var/www/html/web/core/includes/bootstrap.inc(108): _drupal_error_handler_real()
    #1 [internal function]: _drupal_error_handler()
    #2 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(278): array_flip()
    #3 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(262): Drupal\Core\Entity\EntityStorageBase->loadMultiple()
    #4 /var/www/html/web/modules/contrib/gifplayer/src/Plugin/Field/FieldFormatter/GifPlayerVideoFormatter.php(78): Drupal\Core\Entity\EntityStorageBase->load()
    #5 /var/www/html/web/core/lib/Drupal/Core/Field/FormatterBase.php(91): Drupal\gifplayer\Plugin\Field\FieldFormatter\GifPlayerVideoFormatter->viewElements()
    #6 /var/www/html/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceFormatterBase.php(83): Drupal\Core\Field\FormatterBase->view()
    #7 /var/www/html/web/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php(275): Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase->view()
    #8 /var/www/html/web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php(286): Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple()
    #9 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(340): Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple()
    #10 /var/www/html/web/core/modules/node/src/NodeViewBuilder.php(24): Drupal\Core\Entity\EntityViewBuilder->buildComponents()
    #11 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(282): Drupal\node\NodeViewBuilder->buildComponents()
    #12 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(239): Drupal\Core\Entity\EntityViewBuilder->buildMultiple()
    #13 [internal function]: Drupal\Core\Entity\EntityViewBuilder->build()
    #14 /var/www/html/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(107): call_user_func_array()
    #15 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(825): Drupal\Core\Render\Renderer->doTrustedCallback()
    #16 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(387): Drupal\Core\Render\Renderer->doCallback()
    #17 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(203): Drupal\Core\Render\Renderer->doRender()
    #18 /var/www/html/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(238): Drupal\Core\Render\Renderer->render()
    #19 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(593): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
    #20 /var/www/html/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(231): Drupal\Core\Render\Renderer->executeInRenderContext()
    #21 /var/www/html/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(128): Drupal\Core\Render\MainContent\HtmlRenderer->prepare()
    #22 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
    #23 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(246): Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
    #24 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(206): Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}()
    #25 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
    #26 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(188): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
    #27 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
    #28 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
    #29 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
    #30 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
    #31 /var/www/html/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
    #32 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
    #33 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass()
    #34 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
    #35 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
    #36 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
    #37 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
    #38 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(709): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
    #39 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle()
    #40 {main}
    
  • 🇨🇦Canada danrod Ottawa

    I'm think of deleting the The Gif Player Video field, it never worked in the first place and it seems like nobody is using, and after the recent vulnerability found in the GifPlayer Library, I can't risk having another potential security issue even if I fix this, so I'll delete it.

  • Merge request !10Issue # 3518499: Removed Gif Player Video field → (Merged) created by danrod
  • 🇨🇦Canada danrod Ottawa

    I tested it and works ok, the MR is: https://git.drupalcode.org/project/gifplayer/-/merge_requests/10

    I'll leave to "Needs Review" just in case anyone wants to review this.

  • 🇨🇦Canada danrod Ottawa
  • 🇨🇦Canada danrod Ottawa

    I'll move it to "Fixed", if anyone still wants this feature, drop me a line and I'll try to fix it, I'll update the 8.x-1.x branch as well.

  • 🇨🇦Canada danrod Ottawa
  • 🇨🇦Canada danrod Ottawa
  • Merge request !11Resolve #3518499 "Delete gifplayervideo" → (Merged) created by danrod
  • 🇨🇦Canada danrod Ottawa

    danrod changed the visibility of the branch 3518499-delete-gifplayervideo to hidden.

  • 🇨🇦Canada danrod Ottawa

    danrod changed the visibility of the branch 3518499-delete-gifplayervideo to active.

Production build 0.71.5 2024