UI patterns views throws fatal error

Created on 4 February 2025, 2 months ago

Problem/Motivation

When using views with ui_patterns get

Error: Call to a member function entityClassImplements() on null in Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase->getEntityBundleFieldMetadataEntityReference() (line 241 of /home/ide/project/docroot/modules/contrib/ui_patterns/src/Plugin/Derivative/EntityFieldSourceDeriverBase.php).
#0 /home/ide/project/docroot/modules/contrib/ui_patterns/src/Plugin/Derivative/EntityFieldSourceDeriverBase.php(296): Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase->getEntityBundleFieldMetadataEntityReference()
#1 /home/ide/project/docroot/modules/contrib/ui_patterns/src/Plugin/Derivative/EntityFieldSourceDeriverBase.php(329): Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase->getEntityBundleFieldsMetadata()
#2 /home/ide/project/docroot/modules/contrib/ui_patterns/src/Plugin/Derivative/EntityFieldSourceDeriverBase.php(59): Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase->getEntityFieldsMetadata()
#3 /home/ide/project/docroot/modules/contrib/ui_patterns/src/Plugin/Derivative/EntityFieldSourceDeriverBase.php(66): Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase->__construct()
#4 /home/ide/project/docroot/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecorator.php(25): Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase::create()

Steps to reproduce

On 10.4.1 (or latest D10 version)
Install ui_patterns and ui_patterns_views
Create a view that uses a pattern
When selecting a pattern get an Ajax fatal error

Proposed resolution

TBD

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

UI Patterns Views

Created by

πŸ‡ΊπŸ‡ΈUnited States smustgrave

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

Merge Requests

Comments & Activities

  • Issue created by @smustgrave
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave
  • πŸ‡«πŸ‡·France pdureau Paris
  • First commit to issue fork.
  • Pipeline finished with Success
    about 2 months ago
    Total: 604s
    #416097
  • πŸ‡«πŸ‡·France pdureau Paris

    to review

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    For me this didn’t resolve the issue.

    May be good to opt into other versions in the gitlab file?

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Full stack trace

    #0 /home/ide/project/docroot/modules/contrib/ui_patterns/src/Plugin/Derivative/EntityFieldSourceDeriverBase.php(296): Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase->getEntityBundleFieldMetadataEntityReference()
    #1 /home/ide/project/docroot/modules/contrib/ui_patterns/src/Plugin/Derivative/EntityFieldSourceDeriverBase.php(329): Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase->getEntityBundleFieldsMetadata()
    #2 /home/ide/project/docroot/modules/contrib/ui_patterns/src/Plugin/Derivative/EntityFieldSourceDeriverBase.php(59): Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase->getEntityFieldsMetadata()
    #3 /home/ide/project/docroot/modules/contrib/ui_patterns/src/Plugin/Derivative/EntityFieldSourceDeriverBase.php(66): Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase->__construct()
    #4 /home/ide/project/docroot/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecorator.php(25): Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase::create()
    #5 /home/ide/project/docroot/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(99): Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator->getDeriver()
    #6 /home/ide/project/docroot/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives()
    #7 /home/ide/project/docroot/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(337): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
    #8 /home/ide/project/docroot/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(213): Drupal\Core\Plugin\DefaultPluginManager->findDefinitions()
    #9 /home/ide/project/docroot/core/lib/Drupal/Core/Plugin/Context/ContextAwarePluginManagerTrait.php(23): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
    #10 /home/ide/project/docroot/modules/contrib/ui_patterns/src/ContextMatcherPluginManagerTrait.php(61): Drupal\ui_patterns\SourcePluginManager->getDefinitionsForContexts()
    #11 /home/ide/project/docroot/modules/contrib/ui_patterns/src/ContextMatcherPluginManagerTrait.php(43): Drupal\ui_patterns\SourcePluginManager->getDefinitionsMatchingContexts()
    #12 /home/ide/project/docroot/modules/contrib/ui_patterns/src/SourcePluginManager.php(154): Drupal\ui_patterns\SourcePluginManager->getDefinitionsMatchingContextsAndTags()
    #13 /home/ide/project/docroot/modules/contrib/ui_patterns/src/SourcePluginManager.php(122): Drupal\ui_patterns\SourcePluginManager->getNativeDefinitionsForPropType()
    #14 /home/ide/project/docroot/modules/contrib/ui_patterns/src/Element/ComponentFormBase.php(166): Drupal\ui_patterns\SourcePluginManager->getDefinitionsForPropType()
    #15 /home/ide/project/docroot/modules/contrib/ui_patterns/src/Element/ComponentSlotForm.php(318): Drupal\ui_patterns\Element\ComponentFormBase::getSources()
    #16 /home/ide/project/docroot/modules/contrib/ui_patterns/src/Element/ComponentSlotForm.php(163): Drupal\ui_patterns\Element\ComponentSlotForm::buildAddSourceButton()
    #17 [internal function]: Drupal\ui_patterns\Element\ComponentSlotForm::buildForm()
    #18 /home/ide/project/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1006): call_user_func_array()
    #19 /home/ide/project/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1069): Drupal\Core\Form\FormBuilder->doBuildForm()
    #20 /home/ide/project/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1069): Drupal\Core\Form\FormBuilder->doBuildForm()
    #21 /home/ide/project/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1069): Drupal\Core\Form\FormBuilder->doBuildForm()
    #22 /home/ide/project/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1069): Drupal\Core\Form\FormBuilder->doBuildForm()
    #23 /home/ide/project/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1069): Drupal\Core\Form\FormBuilder->doBuildForm()
    #24 /home/ide/project/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1069): Drupal\Core\Form\FormBuilder->doBuildForm()
    #25 /home/ide/project/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(579): Drupal\Core\Form\FormBuilder->doBuildForm()
    #26 /home/ide/project/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(326): Drupal\Core\Form\FormBuilder->processForm()
    #27 /home/ide/project/docroot/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php(215): Drupal\Core\Form\FormBuilder->buildForm()
    #28 /home/ide/project/docroot/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\views_ui\Form\Ajax\ViewsFormBase->Drupal\views_ui\Form\Ajax\{closure}()
    #29 /home/ide/project/docroot/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php(217): Drupal\Core\Render\Renderer->executeInRenderContext()
    #30 /home/ide/project/docroot/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php(127): Drupal\views_ui\Form\Ajax\ViewsFormBase->ajaxFormWrapper()
    #31 /home/ide/project/docroot/core/modules/views_ui/src/Form/Ajax/Display.php(46): Drupal\views_ui\Form\Ajax\ViewsFormBase->getForm()
    #32 [internal function]: Drupal\views_ui\Form\Ajax\Display->getForm()
    #33 /home/ide/project/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
    #34 /home/ide/project/docroot/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #35 /home/ide/project/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
    #36 /home/ide/project/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
    #37 /home/ide/project/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #38 /home/ide/project/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
    #39 /home/ide/project/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
    #40 /home/ide/project/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
    #41 /home/ide/project/docroot/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
    #42 /home/ide/project/docroot/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
    #43 /home/ide/project/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
    #44 /home/ide/project/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass()
    #45 /home/ide/project/docroot/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle()
    #46 /home/ide/project/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle()
    #47 /home/ide/project/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
    #48 /home/ide/project/docroot/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
    #49 /home/ide/project/docroot/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
    #50 /home/ide/project/docroot/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
    #51 /home/ide/project/docroot/index.php(19): Drupal\Core\DrupalKernel->handle()
    #52 {main}

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Error: Call to a member function entityClassImplements() on null in Drupal\ui_patterns\Plugin\Derivative\EntityFieldSourceDeriverBase->getEntityBundleFieldMetadataEntityReference() (line 241 of /home/ide/project/docroot/modules/contrib/ui_patterns/src/Plugin/Derivative/EntityFieldSourceDeriverBase.php).

  • Pipeline finished with Success
    about 2 months ago
    Total: 555s
    #416958
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Confirming from our slack chat. The fix in the MR did fix the issue for me THANKS!

  • Pipeline finished with Success
    about 2 months ago
    Total: 576s
    #417004
  • πŸ‡«πŸ‡·France pdureau Paris
  • Pipeline finished with Success
    about 1 month ago
    Total: 271s
    #440003
Production build 0.71.5 2024