Error: Call to a member function getTransitions() on null

Created on 27 November 2019, almost 5 years ago
Updated 24 November 2023, 12 months ago

When I try to add state_machine field block on Layout Builder template I have:

Error: Call to a member function getTransitions() on null в Drupal\state_machine\Form\StateTransitionForm->buildForm() (строка 88 из /var/www/drupal_8/web/modules/contrib/state_machine/src/Form/StateTransitionForm.php)
#0 [internal function]: Drupal\state_machine\Form\StateTransitionForm->buildForm(Array, Object(Drupal\Core\Form\FormState))
#1 /var/www/drupal_8/web/core/lib/Drupal/Core/Form/FormBuilder.php(520): call_user_func_array(Array, Array)
#2 /var/www/drupal_8/web/core/lib/Drupal/Core/Form/FormBuilder.php(277): Drupal\Core\Form\FormBuilder->retrieveForm('state_machine_t...', Object(Drupal\Core\Form\FormState))
#3 /var/www/drupal_8/web/modules/contrib/state_machine/src/Plugin/Field/FieldFormatter/StateTransitionFormFormatter.php(105): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\state_machine\Form\StateTransitionForm), Object(Drupal\Core\Form\FormState))
#4 /var/www/drupal_8/web/core/lib/Drupal/Core/Field/FormatterBase.php(89): Drupal\state_machine\Plugin\Field\FieldFormatter\StateTransitionFormFormatter->viewElements(Object(Drupal\Core\Field\FieldItemList), 'ru')
#5 /var/www/drupal_8/web/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php(263): Drupal\Core\Field\FormatterBase->view(Object(Drupal\Core\Field\FieldItemList), 'ru')
#6 /var/www/drupal_8/web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php(267): Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array)
#7 /var/www/drupal_8/web/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php(221): Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple(Array)
#8 /var/www/drupal_8/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(464): Drupal\Core\Entity\Entity\EntityViewDisplay->build(Object(Drupal\node\Entity\Node))
#9 /var/www/drupal_8/web/core/lib/Drupal/Core/Field/FieldItemList.php(243): Drupal\Core\Entity\EntityViewBuilder->viewField(Object(Drupal\Core\Field\FieldItemList), Array)
#10 /var/www/drupal_8/web/core/modules/layout_builder/src/Plugin/Block/FieldBlock.php(162): Drupal\Core\Field\FieldItemList->view(Array)
#11 /var/www/drupal_8/web/core/modules/layout_builder/src/EventSubscriber/BlockComponentRenderArray.php(104): Drupal\layout_builder\Plugin\Block\FieldBlock->build()
#12 [internal function]: Drupal\layout_builder\EventSubscriber\BlockComponentRenderArray->onBuildRender(Object(Drupal\layout_builder\Event\SectionComponentBuildRenderArrayEvent), 'section_compone...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#13 /var/www/drupal_8/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Drupal\layout_builder\Event\SectionComponentBuildRenderArrayEvent), 'section_compone...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#14 /var/www/drupal_8/web/core/modules/layout_builder/src/SectionComponent.php(90): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('section_compone...', Object(Drupal\layout_builder\Event\SectionComponentBuildRenderArrayEvent))
#15 /var/www/drupal_8/web/core/modules/layout_builder/src/Section.php(86): Drupal\layout_builder\SectionComponent->toRenderArray(Array, true)
#16 /var/www/drupal_8/web/core/modules/layout_builder/src/Element/LayoutBuilder.php(250): Drupal\layout_builder\Section->toRenderArray(Array, true)
#17 /var/www/drupal_8/web/core/modules/layout_builder/src/Element/LayoutBuilder.php(123): Drupal\layout_builder\Element\LayoutBuilder->buildAdministrativeSection(Object(Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage), 0)
#18 /var/www/drupal_8/web/core/modules/layout_builder/src/Element/LayoutBuilder.php(97): Drupal\layout_builder\Element\LayoutBuilder->layout(Object(Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage))
#19 [internal function]: Drupal\layout_builder\Element\LayoutBuilder->preRender(Array)
#20 /var/www/drupal_8/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(100): call_user_func_array(Array, Array)
#21 /var/www/drupal_8/web/core/lib/Drupal/Core/Render/Renderer.php(781): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render
#pre_ren...', 'silenced_deprec...', 'Drupal\\Core\\Ren...')
#22 /var/www/drupal_8/web/core/lib/Drupal/Core/Render/Renderer.php(372): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
#23 /var/www/drupal_8/web/core/lib/Drupal/Core/Render/Renderer.php(200): Drupal\Core\Render\Renderer->doRender(Array, true)
#24 /var/www/drupal_8/web/core/lib/Drupal/Core/Render/Renderer.php(144): Drupal\Core\Render\Renderer->render(Array, true)
#25 /var/www/drupal_8/web/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
#26 /var/www/drupal_8/web/core/lib/Drupal/Core/Render/Renderer.php(145): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#27 /var/www/drupal_8/web/core/lib/Drupal/Core/Ajax/CommandWithAttachedAssetsTrait.php(37): Drupal\Core\Render\Renderer->renderRoot(Array)
#28 /var/www/drupal_8/web/core/lib/Drupal/Core/Ajax/ReplaceCommand.php(31): Drupal\Core\Ajax\InsertCommand->getRenderedContent()
#29 /var/www/drupal_8/web/core/lib/Drupal/Core/Ajax/AjaxResponse.php(43): Drupal\Core\Ajax\ReplaceCommand->render()
#30 /var/www/drupal_8/web/core/modules/layout_builder/src/Controller/LayoutRebuildTrait.php(47): Drupal\Core\Ajax\AjaxResponse->addCommand(Object(Drupal\Core\Ajax\ReplaceCommand))
#31 /var/www/drupal_8/web/core/modules/layout_builder/src/Controller/LayoutRebuildTrait.php(26): Drupal\layout_builder\Form\ConfigureBlockFormBase->rebuildLayout(Object(Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage))
#32 /var/www/drupal_8/web/core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php(242): Drupal\layout_builder\Form\ConfigureBlockFormBase->rebuildAndClose(Object(Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage))
#33 /var/www/drupal_8/web/core/lib/Drupal/Core/Ajax/AjaxFormHelperTrait.php(39): Drupal\layout_builder\Form\ConfigureBlockFormBase->successfulAjaxSubmit(Array, Object(Drupal\Core\Form\FormState))
#34 [internal function]: Drupal\layout_builder\Form\ConfigureBlockFormBase->ajaxSubmit(Array, Object(Drupal\Core\Form\FormState), Object(Symfony\Component\HttpFoundation\Request))
#35 /var/www/drupal_8/web/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php(69): call_user_func_array(Array, Array)
#36 /var/www/drupal_8/web/core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php(109): Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse(Object(Symfony\Component\HttpFoundation\Request), Array, Object(Drupal\Core\Form\FormState), Array)
#37 [internal function]: Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber->onException(Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent), 'kernel.exceptio...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#38 /var/www/drupal_8/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent), 'kernel.exceptio...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#39 /var/www/drupal_8/vendor/symfony/http-kernel/HttpKernel.php(227): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.exceptio...', Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent))
#40 /var/www/drupal_8/vendor/symfony/http-kernel/HttpKernel.php(79): Symfony\Component\HttpKernel\HttpKernel->handleException(Object(Drupal\Core\Form\FormAjaxException), Object(Symfony\Component\HttpFoundation\Request), 1)
#41 /var/www/drupal_8/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#42 /var/www/drupal_8/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#43 /var/www/drupal_8/web/core/modules/ban/src/BanMiddleware.php(50): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#44 /var/www/drupal_8/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#45 /var/www/drupal_8/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#46 /var/www/drupal_8/web/modules/custom/rg_location/src/RedirectToCityMiddleware.php(81): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#47 /var/www/drupal_8/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\rg_location\RedirectToCityMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#48 /var/www/drupal_8/web/core/lib/Drupal/Core/DrupalKernel.php(694): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#49 /var/www/drupal_8/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#50 {main}.

Patch will be attached.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇷🇸Serbia super_romeo Belgrade

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

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