Warning: Undefined array key "items" in Drupal\views

Created on 22 November 2023, about 1 year ago
Updated 30 November 2023, about 1 year ago

Problem/Motivation

Using a block I created from views to display a slick slideshow on a page I no longer have any images.
Worked fine up until I upgraded to Drupal 10.1.6 from 9.5

The view is set to
Unformatted list
Field Formatter is set to Slick Image
And Doesn't matter which optionset I choose or display style
When i'm in views the block or the page I get

Warning: Undefined array key "items" in Drupal\views\Plugin\views\field\EntityField->getItems() (line 884 of /data/www-root/test/web/core/modules/views/src/Plugin/views/field/EntityField.php)
#0 /data/www-root/test/web/core/includes/bootstrap.inc(164): _drupal_error_handler_real()
#1 /data/www-root/test/web/core/modules/views/src/Plugin/views/field/EntityField.php(884): _drupal_error_handler()
#2 /data/www-root/test/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(1189): Drupal\views\Plugin\views\field\EntityField->getItems()
#3 /data/www-root/test/web/core/modules/views/views.theme.inc(238): Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender()
#4 [internal function]: template_preprocess_views_view_field()
#5 /data/www-root/test/web/core/lib/Drupal/Core/Theme/ThemeManager.php(285): call_user_func_array()
#6 /data/www-root/test/web/core/lib/Drupal/Core/Render/Renderer.php(445): Drupal\Core\Theme\ThemeManager->render()
#7 /data/www-root/test/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
#8 /data/www-root/test/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(1784): Drupal\Core\Render\Renderer->render()
#9 /data/www-root/test/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(765): Drupal\views\Plugin\views\field\FieldPluginBase->theme()
#10 [internal function]: Drupal\views\Plugin\views\style\StylePluginBase->elementPreRenderRow()
#11 /data/www-root/test/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(111): call_user_func_array()
#12 /data/www-root/test/web/core/lib/Drupal/Core/Render/Renderer.php(797): Drupal\Core\Render\Renderer->doTrustedCallback()
#13 /data/www-root/test/web/core/lib/Drupal/Core/Render/Renderer.php(386): Drupal\Core\Render\Renderer->doCallback()
#14 /data/www-root/test/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
#15 /data/www-root/test/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(704): Drupal\Core\Render\Renderer->render()
#16 /data/www-root/test/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(570): Drupal\views\Plugin\views\style\StylePluginBase->renderFields()
#17 /data/www-root/test/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(461): Drupal\views\Plugin\views\style\StylePluginBase->renderGrouping()
#18 /data/www-root/test/web/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(2181): Drupal\views\Plugin\views\style\StylePluginBase->render()
#19 /data/www-root/test/web/core/modules/views/src/ViewExecutable.php(1548): Drupal\views\Plugin\views\display\DisplayPluginBase->render()
#20 /data/www-root/test/web/core/modules/views/src/Plugin/views/display/Block.php(131): Drupal\views\ViewExecutable->render()
#21 /data/www-root/test/web/core/modules/views/src/ViewExecutable.php(1645): Drupal\views\Plugin\views\display\Block->execute()
#22 /data/www-root/test/web/core/modules/views/src/Element/View.php(81): Drupal\views\ViewExecutable->executeDisplay()
#23 /data/www-root/test/web/core/modules/views/src/Plugin/Block/ViewsBlock.php(59): Drupal\views\Element\View::preRenderViewElement()
#24 /data/www-root/test/web/core/modules/block/src/BlockViewBuilder.php(171): Drupal\views\Plugin\Block\ViewsBlock->build()
#25 [internal function]: Drupal\block\BlockViewBuilder::preRender()
#26 /data/www-root/test/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(111): call_user_func_array()
#27 /data/www-root/test/web/core/lib/Drupal/Core/Render/Renderer.php(797): Drupal\Core\Render\Renderer->doTrustedCallback()
#28 /data/www-root/test/web/core/lib/Drupal/Core/Render/Renderer.php(386): Drupal\Core\Render\Renderer->doCallback()
#29 /data/www-root/test/web/core/lib/Drupal/Core/Render/Renderer.php(458): Drupal\Core\Render\Renderer->doRender()
#30 /data/www-root/test/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
#31 /data/www-root/test/web/core/lib/Drupal/Core/Template/TwigExtension.php(474): Drupal\Core\Render\Renderer->render()
#32 /data/www-root/test/vendor/twig/twig/src/Environment.php(361) : eval()'d code(180): Drupal\Core\Template\TwigExtension->escapeFilter()
#33 /data/www-root/test/vendor/twig/twig/src/Template.php(171): __TwigTemplate_65ff80c87b62e61f3cf7e32261400094->block_content()
#34 /data/www-root/test/vendor/twig/twig/src/Environment.php(361) : eval()'d code(89): Twig\Template->displayBlock()
#35 /data/www-root/test/vendor/twig/twig/src/Template.php(394): __TwigTemplate_9f7d37ec86cf213f0826dc2ddee758f8->doDisplay()
#36 /data/www-root/test/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling()
#37 /data/www-root/test/vendor/twig/twig/src/Environment.php(361) : eval()'d code(46): Twig\Template->display()
#38 /data/www-root/test/vendor/twig/twig/src/Template.php(394): __TwigTemplate_65ff80c87b62e61f3cf7e32261400094->doDisplay()
#39 /data/www-root/test/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling()
#40 /data/www-root/test/vendor/twig/twig/src/Template.php(379): Twig\Template->display()
#41 /data/www-root/test/vendor/twig/twig/src/TemplateWrapper.php(40): Twig\Template->render()
#42 /data/www-root/test/web/core/themes/engines/twig/twig.engine(53): Twig\TemplateWrapper->render()
#43 /data/www-root/test/web/core/lib/Drupal/Core/Theme/ThemeManager.php(372): twig_render_template()
#44 /data/www-root/test/web/core/lib/Drupal/Core/Render/Renderer.php(445): Drupal\Core\Theme\ThemeManager->render()
#45 /data/www-root/test/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
#46 /data/www-root/test/web/core/lib/Drupal/Core/Template/TwigExtension.php(474): Drupal\Core\Render\Renderer->render()
#47 /data/www-root/test/vendor/twig/twig/src/Environment.php(361) : eval()'d code(84): Drupal\Core\Template\TwigExtension->escapeFilter()
#48 /data/www-root/test/vendor/twig/twig/src/Template.php(394): __TwigTemplate_af44b76e0af565c3f75f0a379712f163->doDisplay()
#49 /data/www-root/test/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling()
#50 /data/www-root/test/vendor/twig/twig/src/Template.php(379): Twig\Template->display()
#51 /data/www-root/test/vendor/twig/twig/src/TemplateWrapper.php(40): Twig\Template->render()
#52 /data/www-root/test/web/core/themes/engines/twig/twig.engine(53): Twig\TemplateWrapper->render()
#53 /data/www-root/test/web/core/lib/Drupal/Core/Theme/ThemeManager.php(372): twig_render_template()
#54 /data/www-root/test/web/core/lib/Drupal/Core/Render/Renderer.php(445): Drupal\Core\Theme\ThemeManager->render()
#55 /data/www-root/test/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
#56 /data/www-root/test/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(158): Drupal\Core\Render\Renderer->render()
#57 /data/www-root/test/web/core/lib/Drupal/Core/Render/Renderer.php(592): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#58 /data/www-root/test/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(159): Drupal\Core\Render\Renderer->executeInRenderContext()
#59 /data/www-root/test/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
#60 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
#61 /data/www-root/test/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#62 /data/www-root/test/vendor/symfony/http-kernel/HttpKernel.php(186): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#63 /data/www-root/test/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#64 /data/www-root/test/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#65 /data/www-root/test/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#66 /data/www-root/test/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#67 /data/www-root/test/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#68 /data/www-root/test/web/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle()
#69 /data/www-root/test/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle()
#70 /data/www-root/test/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#71 /data/www-root/test/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#72 /data/www-root/test/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#73 /data/www-root/test/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#74 {main}

Any advise would be appreciated.

💬 Support request
Status

Fixed

Version

2.10

Component

Documentation

Created by

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

Comments & Activities

  • Issue created by @mrdrill
  • Status changed to Postponed about 1 year ago
  • 🇮🇩Indonesia gausarts

    Thank you.

    Common upgrade (not update) issues:

    1. Missing images due to environmental changes from prod to dev/ staging, hardly an issue if vice versa. Sub-folder installs, not multi-site, etc.

    Try F12, inspect image IMG elements, and open the loaded URL in your browsers.
    404 or 403 should be explanatory, and require server-side actions. Re-chmod your private, tmp, and files folders in case any differences.

    Other commons are impartial changes, one of them noted under Views Gotchas at the bottom of Slick Views page.

    About undefined "items", to debug, change formatters into defaults. And see if persists?

    At worst scenario solutions for upgrades and unkown errors like class BLAH not found, etc:

    1. Rename composer .lock into .bak
    2. Rename vendor folder into -bak
    3. Or delete them all if you are confident and have good connections.
    4. Then re-run regular composer update -W -n ....

    Let me know which one is close?

  • Thank you so much for the reply and pointers.
    In the end it turns out I had to check Use field template under Style settings once i did this everything worked again.

  • Status changed to Fixed about 1 year ago
  • 🇮🇩Indonesia gausarts

    Thanks for the followup.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024