Undefined array key : views_view_fullcalendar

Created on 31 March 2022, over 2 years ago
Updated 15 November 2023, about 1 year ago

Problem/Motivation

Warning: Undefined array key 20 in Drupal\views\Plugin\views\field\EntityField->prepareItemsByDelta() (line 737 of core/modules/views/src/Plugin/views/field/EntityField.php).

Using Drupal 9, SmartDate Reccuring fields with fullcalendar_view. After updating to 5.1.4 i got following Warning:

Warning: Undefined array key 20 in Drupal\views\Plugin\views\field\EntityField->prepareItemsByDelta() (line 737 of core/modules/views/src/Plugin/views/field/EntityField.php).

Drupal\views\Plugin\views\field\EntityField->prepareItemsByDelta(Array) (Line: 882)
Drupal\views\Plugin\views\field\EntityField->getItems(Object) (Line: 1149)
Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender(Object) (Line: 171)
Drupal\fullcalendar_view\FullcalendarViewPreprocess->process(Array) (Line: 32)
template_preprocess_views_view_fullcalendar(Array, 'views_view_fullcalendar', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('views_view_fullcalendar', Array) (Line: 422)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 435)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 110)
__TwigTemplate_69da86d82d22830d9264d5b3689f99f289fd015db8a89e5a3fb1b6e7d5312b57->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('core/themes/classy/templates/views/views-view.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('views_view', Array) (Line: 422)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 435)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 80)
__TwigTemplate_0f25593a1e7c9becddfc812ebb8603cb99d80a41f7feccf1a845286c876877ae->block_content(Array, Array) (Line: 182)
Twig\Template->displayBlock('content', Array, Array) (Line: 68)
__TwigTemplate_0f25593a1e7c9becddfc812ebb8603cb99d80a41f7feccf1a845286c876877ae->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/os_bs5_bhs/templates/block/block--views-block.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('block', Array) (Line: 422)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 435)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 226)
__TwigTemplate_9c30e37fc6403509d4011696b45a10dde738d0e133e7269d21fc8a7c11d5d1a9->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/os_bs5_bhs/templates/layout/page.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 422)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 89)
__TwigTemplate_e5d1859c7a029f839e574542bde0b77176d59209c2e45cc5b2bafc93ff759f00->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/os_bs5_bhs/templates/layout/html.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 422)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array) (Line: 162)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 163)
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: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->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: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

i dont know wether the problem occurs on more installation or not. My way to fix this could be a wax to reproduce it.

Proposed resolution

Remaining tasks

User interface changes

no changes made in the user interface, only composer updates.

API changes

??

Data model changes

??

πŸ› Bug report
Status

Closed: outdated

Version

5.1

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany olisongs

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.

  • πŸ‡©πŸ‡ͺGermany olisongs

    who can merge this?

    #5 /var/www/vhosts/website/web/modules/contrib/fullcalendar_view/fullcalendar_view.theme.inc(32): Drupal\fullcalendar_view\FullcalendarViewPreprocess->process()

    line 32

    if (isset($variables)) {
    $preprocess_service->process($variables);
    }

    at the first test it is working.

  • @olisongs opened merge request.
  • Status changed to Closed: outdated over 1 year ago
  • πŸ‡¦πŸ‡ΊAustralia mingsong πŸ‡¦πŸ‡Ί
  • πŸ‡ΊπŸ‡ΈUnited States Kasey_MK

    FWIW I encountered this on fullcalendar_view 5.1.13, Drupal 10.1.16, PHP 8.1.21.

    I'm using a patch to integrate fullcalendar_view with search_api (1.30.0) based on work in Integration with Search API ✨ Integration with Search API Needs review . I don't know if that's relevant, but I didn't see this error message until after I started using search_api and search_api_solr as the base for fullcalendar_view, so I mention it.

    My calendar grids look fine and show all the events that I expect to see, including recurring events - I just had a flood of these warning messages at the tops of some of my calendar pages.

    This change in src/FullcalendarViewPreprocess.php seems to allow everything that's already working to continue working, and gets rid of the warning messages:

    -$des[$idkey] = $field->advancedRender($row);
    +if (array_key_exists($idkey, $des)) {
    +  $des[$idkey] = $field->advancedRender($row);
    +}
  • πŸ‡ΊπŸ‡ΈUnited States Kasey_MK

    Gah nevermind that code snippet in #12; it did make the warnings go away but it also messed up the view row data.

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

    What ended up making those errors go away for me was not using the fullcalendar_view to render a multi-value field's first value only. Instead, I used a custom field formatter and a custom node view mode to render only the first value of the field in question, and including that in my view instead of the multi-value field. In my case I'm using search_api and search_api_solr, so I added the rendered HTML as a storage-only field in my search index, but perhaps that would work with a rendered entity in the view too.

Production build 0.71.5 2024