Warning: Illegal offset type in ContentEntityStorageBase->getFromPersistentCache()

Created on 6 May 2017, over 7 years ago
Updated 12 April 2024, 9 months ago

When I add add {{ drupal_view('bijbehorende_producten', 'block_1', field_producttype_1 )}} in my view I get the warning below, Only after saving the view or clearing the cache. Without an argument it does not give any errors

Not sure if the fault lives here or somewhere else as I found a related issue .

Warning: Illegal offset type in Drupal\Core\Entity\ContentEntityStorageBase->getFromPersistentCache() (line 591 of core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php).
Drupal\Core\Entity\ContentEntityStorageBase->getFromPersistentCache(Array) (Line: 396)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->doLoadMultiple(Array) (Line: 242)
Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array) (Line: 507)
Drupal\Core\Entity\Entity::loadMultiple(Array) (Line: 19)
Drupal\taxonomy\Plugin\views\argument\IndexTid->titleQuery() (Line: 153)
Drupal\views\Plugin\views\argument\ManyToOne->title() (Line: 976)
Drupal\views\Plugin\views\argument\ArgumentPluginBase->getTitle() (Line: 1099)
Drupal\views\ViewExecutable->_buildArguments() (Line: 1254)
Drupal\views\ViewExecutable->build(NULL) (Line: 1378)
Drupal\views\ViewExecutable->execute(NULL) (Line: 1441)
Drupal\views\ViewExecutable->render() (Line: 2391)
Drupal\views\Plugin\views\display\DisplayPluginBase->preview() (Line: 1649)
Drupal\views\ViewExecutable->preview('block_1', Array) (Line: 63)
Drupal\views\Element\View::preRenderViewElement(Array)
call_user_func(Array, Array) (Line: 376)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 474)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 94)
__TwigTemplate_24cdf5df7d7fb14a7ef085dd4347a3d935fd098fbc4a8818edf1079f09f7cb21->doDisplay(Array, Array) (Line: 432)
Twig_Template->displayWithErrorHandling(Array, Array) (Line: 403)
Twig_Template->display(Array) (Line: 411)
Twig_Template->render(Array) (Line: 116)
Drupal\Core\Template\TwigEnvironment->renderInline('{# inline_template_start #}

{{ field_productfoto }} 
{{ title }}
{{ body }}


Ingrediënten
{{ field_ingredienten }}






{# Match integer #}
{% if field_producttype_1 matches '/^\\d+$/' %}
{{ drupal_view('bijbehorende_producten', 'block_1', field_producttype_1 )}}
{% endif %}

', Array) (Line: 52)
Drupal\Core\Render\Element\InlineTemplate::preRenderInlineTemplate(Array)
call_user_func(Array, Array) (Line: 376)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 151)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 152)
Drupal\Core\Render\Renderer->renderPlain(Array) (Line: 407)
Drupal\views\Plugin\views\PluginBase->viewsTokenReplace('

{{ field_productfoto }} 
{{ title }}
{{ body }}


Ingrediënten
{{ field_ingredienten }}






{# Match integer #}
{% if field_producttype_1 matches '/^\\d+$/' %}
{{ drupal_view('bijbehorende_producten', 'block_1', field_producttype_1 )}}
{% endif %}

', Array) (Line: 1345)
Drupal\views\Plugin\views\field\FieldPluginBase->renderAltered(Array, Array) (Line: 1238)
Drupal\views\Plugin\views\field\FieldPluginBase->renderText(Array) (Line: 1173)
Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender(Object) (Line: 224)
template_preprocess_views_view_field(Array, 'views_view_field', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('views_view_field', Array) (Line: 435)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 1736)
Drupal\views\Plugin\views\field\FieldPluginBase->theme(Object) (Line: 765)
Drupal\views\Plugin\views\style\StylePluginBase->elementPreRenderRow(Array)
call_user_func(Array, Array) (Line: 376)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 713)
Drupal\views\Plugin\views\style\StylePluginBase->renderFields(Array) (Line: 580)
Drupal\views\Plugin\views\style\StylePluginBase->renderGrouping(Array, Array, 1) (Line: 466)
Drupal\views\Plugin\views\style\StylePluginBase->render(Array) (Line: 2117)
Drupal\views\Plugin\views\display\DisplayPluginBase->render() (Line: 1520)
Drupal\views\ViewExecutable->render() (Line: 171)
Drupal\views\Plugin\views\display\Page->execute() (Line: 1617)
Drupal\views\ViewExecutable->executeDisplay('page_1', Array) (Line: 78)
Drupal\views\Element\View::preRenderViewElement(Array)
call_user_func(Array, Array) (Line: 376)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 149)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 22)
🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Views 

Last updated about 7 hours ago

Created by

🇳🇱Netherlands rbosscher

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

  • 🇮🇳India sourabhutani

    #4 worked and fixed issue for me. Thanks!

  • 🇺🇸United States pmagunia Philadelphia 🇺🇸

    The patch in Comment #4 no longer applies to 10.3.0.

    Trying a reroll. Not sure it works

  • Status changed to Needs review 6 months ago
  • 🇺🇸United States pmagunia Philadelphia 🇺🇸
  • Status changed to Needs work 6 months ago
  • 🇺🇸United States smustgrave

    Thanks for rerolling but recommend putting things into MRs

    Was previously tagged for tests which believe are still needed.

    Also tagging for issue summary to use standard template to include steps to reproduce, remaining tasks, and proposed solution.

  • 🇺🇸United States seth.e.shaw

    We had a very similar issue 🐛 drupal_view breaks in 10.3 Active except the re-roll in #28 didn't work for us because ours popped off in EntityReferenceArgument instead of EntityArgument. The attached uses pmagunia's method on that class as well.

  • 🇺🇸United States rovo Delaware

    #31 solved errors for me on Drupal 10.3.6.

    Error:
    TypeError: Illegal offset type in Drupal\Core\Entity\EntityStorageBase->getFromStaticCache() (line 183 of /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php).

    and Error:
    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).

  • 🇺🇸United States rovo Delaware
Production build 0.71.5 2024