Illegal offset type in isset or empty" at ContentEntityBase.php  

Created on 20 February 2024, 9 months ago

Hi

The content type edit works fine I am able to add the content as soon I hit save the page does not loading and logs the following error

Uncaught PHP Exception TypeError: "Illegal offset type in isset or empty" at core/lib/Drupal/Core/Entity/ContentEntityBase.php line 669  

Regards
Divya

🐛 Bug report
Status

Active

Version

10.1

Component
Entity 

Last updated about 17 hours ago

Created by

🇮🇳India divya.lakshman

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

Comments & Activities

  • Issue created by @divya.lakshman
  • Status changed to Postponed: needs info 9 months ago
  • 🇬🇧United Kingdom longwave UK

    There is not enough information to diagnose the problem, and automated tests would catch this if it happened in a basic install of Drupal.

    If you have a full stack trace, that might be helpful. And if you can reproduce this starting from a fresh install of Drupal, please write down the steps required to create the error.

  • 🇮🇳India divya.lakshman

    This got resolved it was a error driving from a custom module code.

  • Status changed to Closed: works as designed 9 months ago
  • 🇮🇪Ireland keoal

    I added the patch but receive the following error when the module is enabled, it goes away once the module is disabled:

    TypeError: Illegal offset type in Drupal\Core\Entity\ContentEntityBase->get() (line 596 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).
    Drupal\linked_field\LinkedFieldManager->getDestination('field', Array, Array) (Line: 361)
    linked_field_entity_display_build_alter(Array, Array, NULL) (Line: 552)
    Drupal\Core\Extension\ModuleHandler->alter('entity_display_build', Array, Array) (Line: 289)
    Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array) (Line: 282)
    Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple(Array) (Line: 226)
    Drupal\Core\Entity\Entity\EntityViewDisplay->build(Object) (Line: 461)
    Drupal\Core\Entity\EntityViewBuilder->viewField(Object, Array) (Line: 243)
    Drupal\Core\Field\FieldItemList->view(Array) (Line: 167)
    Drupal\layout_builder\Plugin\Block\FieldBlock->build() (Line: 106)
    Drupal\layout_builder\EventSubscriber\BlockComponentRenderArray->onBuildRender(Object, 'section_component.build.render_array', Object)
    call_user_func(Array, Object, 'section_component.build.render_array', Object) (Line: 111)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'section_component.build.render_array') (Line: 90)
    Drupal\layout_builder\SectionComponent->toRenderArray(Array, ) (Line: 88)
    Drupal\layout_builder\Section->toRenderArray(Array) (Line: 331)
    Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildSections(Object) (Line: 291)
    Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple(Array) (Line: 340)
    Drupal\Core\Entity\EntityViewBuilder->buildComponents(Array, Array, Array, 'ergebnisse_anrisstext') (Line: 24)
    Drupal\node\NodeViewBuilder->buildComponents(Array, Array, Array, 'ergebnisse_anrisstext') (Line: 282)
    Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array) (Line: 239)
    Drupal\Core\Entity\EntityViewBuilder->build(Array)
    call_user_func_array(Array, Array) (Line: 113)
    Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725 ', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 870)
    Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 432)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 248)
    Drupal\Core\Render\Renderer->render(Array) (Line: 476)
    Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 66)
    __TwigTemplate_a637f967736943ae7f237fd8018de925->doDisplay(Array, Array) (Line: 393)
    Twig\Template->yield(Array, Array) (Line: 349)
    Twig\Template->display(Array) (Line: 364)
    Twig\Template->render(Array) (Line: 35)
    Twig\TemplateWrapper->render(Array) (Line: 33)
    twig_render_template('themes/contrib/bootstrap_barrio/templates/views/views-view-unformatted.html.twig', Array) (Line: 348)
    Drupal\Core\Theme\ThemeManager->render('views_view_unformatted', Array) (Line: 491)
    Drupal\Core\Render\Renderer->doRender(Array) (Line: 504)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 248)
    Drupal\Core\Render\Renderer->render(Array) (Line: 476)
    Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 115)
    __TwigTemplate_d094ece2a91c0ef6baaf1df1d2f87e48->doDisplay(Array, Array) (Line: 393)
    Twig\Template->yield(Array, Array) (Line: 349)
    Twig\Template->display(Array) (Line: 364)
    Twig\Template->render(Array) (Line: 35)
    Twig\TemplateWrapper->render(Array) (Line: 33)
    twig_render_template('themes/contrib/bootstrap_barrio/templates/views/views-view.html.twig', Array) (Line: 348)
    Drupal\Core\Theme\ThemeManager->render('views_view', Array) (Line: 491)
    Drupal\Core\Render\Renderer->doRender(Array) (Line: 504)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 248)
    Drupal\Core\Render\Renderer->render(Array) (Line: 476)
    Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 94)
    __TwigTemplate_f387d4448419eb25fade8c0d8bab31e6->block_content(Array, Array) (Line: 437)
    Twig\Template->yieldBlock('content', Array, Array) (Line: 73)
    __TwigTemplate_f387d4448419eb25fade8c0d8bab31e6->doDisplay(Array, Array) (Line: 393)
    Twig\Template->yield(Array, Array) (Line: 349)
    Twig\Template->display(Array) (Line: 364)
    Twig\Template->render(Array) (Line: 35)
    Twig\TemplateWrapper->render(Array) (Line: 33)
    twig_render_template('themes/contrib/bootstrap_barrio/templates/block/block.html.twig', Array) (Line: 348)
    Drupal\Core\Theme\ThemeManager->render('block', Array) (Line: 491)
    Drupal\Core\Render\Renderer->doRender(Array) (Line: 504)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 248)
    Drupal\Core\Render\Renderer->render(Array) (Line: 476)
    Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 198)
    __TwigTemplate_815024a4400c3c702ee77437a7e36299->block_content(Array, Array) (Line: 437)
    Twig\Template->yieldBlock('content', Array, Array) (Line: 94)
    __TwigTemplate_af47064ab0f145c76899a71cfdbb5db8->doDisplay(Array, Array) (Line: 393)
    Twig\Template->yield(Array, Array) (Line: 57)
    __TwigTemplate_815024a4400c3c702ee77437a7e36299->doDisplay(Array, Array) (Line: 393)
    Twig\Template->yield(Array, Array) (Line: 349)
    Twig\Template->display(Array) (Line: 364)
    Twig\Template->render(Array) (Line: 35)
    Twig\TemplateWrapper->render(Array) (Line: 33)
    twig_render_template('themes/custom/zirtenet_barrio/templates/page.html.twig', Array) (Line: 348)
    Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 491)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 248)
    Drupal\Core\Render\Renderer->render(Array) (Line: 476)
    Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 91)
    __TwigTemplate_35ce047127c575d07909a37f705ed738->doDisplay(Array, Array) (Line: 393)
    Twig\Template->yield(Array, Array) (Line: 349)
    Twig\Template->display(Array) (Line: 364)
    Twig\Template->render(Array) (Line: 35)
    Twig\TemplateWrapper->render(Array) (Line: 33)
    twig_render_template('themes/custom/zirtenet_barrio/templates/layout/html.html.twig', Array) (Line: 348)
    Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 491)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 248)
    Drupal\Core\Render\Renderer->render(Array) (Line: 158)
    Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 638)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 153)
    Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
    Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
    call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 186)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
    Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 191)
    Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
    Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
    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: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Production build 0.71.5 2024