Video module spawns failure for a fresh Drupal 10 install

Created on 7 April 2023, over 1 year ago
Updated 23 May 2023, over 1 year ago

Problem

When new video field is added, it always yields with error:

/admin/structure/types/manage/video/form-display

  • Video Embed

  • node/add/video:

Drupal\Core\Entity\Query\QueryException: Entity queries must explicitly set whether the query should be access checked or not. See Drupal\Core\Entity\Query\QueryInterface::accessCheck(). in Drupal\Core\Entity\Query\Sql\Query->prepare() (line 141 of core/lib/Drupal/Core/Entity/Query/Sql/Query.php).

Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 396)
Drupal\video\Plugin\Field\FieldWidget\VideoEmbedWidget->extractFormValues() (Line: 237)
Drupal\Core\Entity\Entity\EntityFormDisplay->extractFormValues() (Line: 334)
Drupal\Core\Entity\ContentEntityForm->copyFormValuesToEntity() (Line: 293)
Drupal\Core\Entity\EntityForm->buildEntity() (Line: 155)
Drupal\Core\Entity\ContentEntityForm->buildEntity() (Line: 186)
Drupal\Core\Entity\ContentEntityForm->validateForm()
call_user_func_array() (Line: 82)
Drupal\Core\Form\FormValidator->executeValidateHandlers() (Line: 275)
Drupal\Core\Form\FormValidator->doValidateForm() (Line: 118)
Drupal\Core\Form\FormValidator->validateForm() (Line: 591)
Drupal\Core\Form\FormBuilder->processForm() (Line: 323)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 686)
Drupal\Core\DrupalKernel->handle() (Line: 19)
  • Video Upload

  • node/add/video:

    Error: Call to undefined method Drupal\Component\Utility\Bytes::toInt() in Drupal\video\Plugin\Field\FieldWidget\VideoUploadWidget->getUploadValidators() (line 253 of modules/contrib/video/src/Plugin/Field/FieldWidget/VideoUploadWidget.php).
    
    Drupal\video\Plugin\Field\FieldWidget\VideoUploadWidget->formElement() (Line: 349)
    Drupal\Core\Field\WidgetBase->formSingleElement() (Line: 167)
    Drupal\file\Plugin\Field\FieldWidget\FileWidget->formMultipleElements() (Line: 168)
    Drupal\video\Plugin\Field\FieldWidget\VideoUploadWidget->formMultipleElements() (Line: 111)
    Drupal\Core\Field\WidgetBase->form() (Line: 183)
    Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm() (Line: 121)
    Drupal\Core\Entity\ContentEntityForm->form() (Line: 127)
    Drupal\node\NodeForm->form() (Line: 106)
    Drupal\Core\Entity\EntityForm->buildForm()
    call_user_func_array() (Line: 534)
    Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 281)
    Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult()
    call_user_func_array() (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 74)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 686)
    Drupal\Core\DrupalKernel->handle() (Line: 19)
    

    Add preset /admin/config/media/transcode-preset/add:

    Error message
    
        Warning: Undefined variable $destination in Drupal\video_transcode\Form\PresetFormBase->buildForm() (line 382 of modules/contrib/video/modules/video_transcode/src/Form/PresetFormBase.php).
    
        Drupal\video_transcode\Form\PresetFormBase->buildForm(Array, Object)
        call_user_func_array(Array, Array) (Line: 534)
        Drupal\Core\Form\FormBuilder->retrieveForm('video_transcode_preset_add_form', Object) (Line: 281)
        Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
        Drupal\Core\Controller\FormController->getContentResult(Object, Object)
        call_user_func_array(Array, Array) (Line: 123)
        Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
        Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
        Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
        Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
        Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
        Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
        Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
        Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
        Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
        Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
        Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
        Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
        Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 686)
        Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
    
        Warning: Undefined variable $destination in Drupal\video_transcode\Form\PresetFormBase->buildForm() (line 384 of modules/contrib/video/modules/video_transcode/src/Form/PresetFormBase.php).
    
        Drupal\video_transcode\Form\PresetFormBase->buildForm(Array, Object)
        call_user_func_array(Array, Array) (Line: 534)
        Drupal\Core\Form\FormBuilder->retrieveForm('video_transcode_preset_add_form', Object) (Line: 281)
        Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
        Drupal\Core\Controller\FormController->getContentResult(Object, Object)
        call_user_func_array(Array, Array) (Line: 123)
        Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
        Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
        Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
        Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
        Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
        Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
        Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
        Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
        Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
        Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
        Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
        Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
        Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 686)
        Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

    The versions it was checked against:

    Drupal Version
    10.0.5 | 10.0.7

    PHP Version
    8.1.17 | 8.2.4

    Have to conclude that drupal 7 is much more better than all this madness with promptly created new versions, made with rush.

    ๐Ÿ› Bug report
    Status

    Active

    Version

    3.0

    Component

    Code

    Created by

    ๐Ÿ‡ท๐Ÿ‡บRussia allexim

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

    Comments & Activities

    • Issue created by @allexim
    • ๐Ÿ‡ท๐Ÿ‡บRussia allexim

      Even an attempt to remove the Video Transcode module ends with the failure:

      Error: Call to undefined function drupal_uninstall_schema() in video_transcode_uninstall() (line 114 of modules/contrib/video/modules/video_transcode/video_transcode.install).
      
      call_user_func_array() (Line: 400)
      Drupal\Core\Extension\ModuleHandler->invoke() (Line: 459)
      Drupal\Core\Extension\ModuleInstaller->uninstall() (Line: 91)
      Drupal\Core\ProxyClass\Extension\ModuleInstaller->uninstall() (Line: 174)
      Drupal\system\Form\ModulesUninstallConfirmForm->submitForm()
      call_user_func_array() (Line: 114)
      Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 52)
      Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 595)
      Drupal\Core\Form\FormBuilder->processForm() (Line: 323)
      Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
      Drupal\Core\Controller\FormController->getContentResult()
      call_user_func_array() (Line: 123)
      Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
      Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
      Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
      Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
      Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 74)
      Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
      Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
      Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
      Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
      Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
      Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
      Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
      Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 686)
      Drupal\Core\DrupalKernel->handle() (Line: 19)
      
      
    • ๐Ÿ‡ฉ๐Ÿ‡ชGermany Anybody Porta Westfalica

      This breaks functionality, raising priority!

    • ๐Ÿ‡ท๐Ÿ‡บRussia allexim

      The guys were correct about the solution for:

      • Transcoder preset;
      • Upload widget,

      but the issue with the embed field (after saving) still persists.

      The website encountered an unexpected error. Please try again later.
      
      Drupal\Core\Entity\Query\QueryException: Entity queries must explicitly set whether the query should be access checked or not. See Drupal\Core\Entity\Query\QueryInterface::accessCheck(). in Drupal\Core\Entity\Query\Sql\Query->prepare() (line 141 of core/lib/Drupal/Core/Entity/Query/Sql/Query.php).
      
      Drupal\video\Plugin\Field\FieldWidget\VideoEmbedWidget->extractFormValues() (Line: 237)
    • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kbk1992 Hyderabad

      bharath-kondeti โ†’ made their first commit to this issueโ€™s fork.

    • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kbk1992 Hyderabad

      The code errors have a fixed in separate issues. Please see the links below:
      https://www.drupal.org/project/video/issues/3314510 ๐Ÿ› Entity type 'Drupal\video_transcode\Entity\Preset' is missing 'config_export' definition in its annotation RTBC
      https://www.drupal.org/project/video/issues/3314512 ๐Ÿ› TypeError: htmlspecialchars(): Argument #1 ($string) must be of type string RTBC
      https://www.drupal.org/project/video/issues/3348748 ๐Ÿ› Missing Entity Query Access Check - D10 Compatibility Error Fixed
      https://www.drupal.org/project/video/issues/3353255 ๐Ÿ› Error: Call to undefined method Drupal\Component\Utility\Bytes::toInt() Fixed

    • ๐Ÿ‡ท๐Ÿ‡บRussia allexim

      Sure, Sir (@bharath-kondeti),
      this is - https://www.drupal.org/project/video/issues/3314510 ๐Ÿ› Entity type 'Drupal\video_transcode\Entity\Preset' is missing 'config_export' definition in its annotation RTBC - what i meant by saying "The guys were correct about the solution for..."

      modules/contrib/video/modules/video_transcode/src/Entity/Preset.php

      By the way, if you could notice,
      with the $config['system.logging']['error_level'] = 'verbose'; enabled, the error still persists

      Warning: Undefined variable $destination in Drupal\video_transcode\Form\PresetFormBase->buildForm() (line 382 of modules/contrib/video/modules/video_transcode/src/Form/PresetFormBase.php).
      
      Drupal\video_transcode\Form\PresetFormBase->buildForm(Array, Object)
      call_user_func_array(Array, Array) (Line: 534)
      
      Warning: Undefined variable $destination in Drupal\video_transcode\Form\PresetFormBase->buildForm() (line 384 of modules/contrib/video/modules/video_transcode/src/Form/PresetFormBase.php).
      
      Drupal\video_transcode\Form\PresetFormBase->buildForm(Array, Object)
      call_user_func_array(Array, Array) (Line: 534)
      

      It means, we just have to declare that variable $destination correctly.

      For Drupal 7 the destination was declared that way (/video/modules/video_ui/video.preset.inc):

       // When the scheme is private, Zencoder can't download the file.
        // Force the scheme to public in this case.
        $destination = (file_default_scheme() != 'private' ? file_default_scheme() : 'public') . '://videos/watermark';
      

      file_default_scheme - (/includes/file.inc):

      function file_default_scheme() {
        return variable_get('file_default_scheme', 'public');
      }
      
    • Just to confirm that I installed today the plugin and then tried to remove it (because it's broken for general release for Drupal 10) and got the same error when trying to uninstall:

      The website encountered an unexpected error. Please try again later.
      
      Error: Call to undefined function drupal_uninstall_schema() in video_transcode_uninstall() (line 114 of modules/contrib/video/modules/video_transcode/video_transcode.install).
      
    Production build 0.71.5 2024