Problem/Motivation

I'm intermittently running into this warning on our charts pages. It'll go away for a while and then show back up. I'm not sure where to look to address this issue. I've also tried saving all the views again to see if they stored old settings, but it still happens. We're using Views Highcharts.

Also, I've tried using a grouping field, but it seems to force the wrong behavior in our chart data. Not grouping causes the correct chart behavior, so we're not grouping at the moment if that's the issue. I saw some other issue that indicated that the data needed to have a grouping field, but that makes more problems than it solves.

Warning: Undefined array key "" in Drupal\charts\Plugin\views\style\ChartsPluginStyleChart->renderGrouping() (line 581 of modules/contrib/charts/src/Plugin/views/style/ChartsPluginStyleChart.php).
Drupal\charts\Plugin\views\style\ChartsPluginStyleChart->renderGrouping(Array, Array, 1) (Line: 410)
Drupal\charts\Plugin\views\style\ChartsPluginStyleChart->render() (Line: 2177)
Drupal\views\Plugin\views\display\DisplayPluginBase->render() (Line: 1592)
Drupal\views\ViewExecutable->render() (Line: 133)
Drupal\views\Plugin\views\display\Block->execute() (Line: 1689)
Drupal\views\ViewExecutable->executeDisplay('block_6', Array) (Line: 81)
Drupal\views\Element\View::preRenderViewElement(Array) (Line: 61)
Drupal\views\Plugin\Block\ViewsBlock->build() (Line: 171)
Drupal\block\BlockViewBuilder::preRender(Array)
call_user_func_array('Drupal\block\BlockViewBuilder::preRender', Array) (Line: 113)
Drupal\Core\Render\Renderer->doTrustedCallback('Drupal\block\BlockViewBuilder::preRender', 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', 'Drupal\block\BlockViewBuilder::preRender', Array) (Line: 432)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 504)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 248)
Drupal\Core\Render\Renderer->render(Array) (Line: 475)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 83)
__TwigTemplate_736371f95f320c129ad73ad480eccf1d->block_content(Array, Array) (Line: 430)
Twig\Template->yieldBlock('content', Array, Array) (Line: 69)
__TwigTemplate_736371f95f320c129ad73ad480eccf1d->doDisplay(Array, Array) (Line: 360)
Twig\Template->yield(Array) (Line: 335)
Twig\Template->render(Array) (Line: 38)
Twig\TemplateWrapper->render(Array) (Line: 33)
twig_render_template('themes/custom/MY_THEME/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: 475)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 297)
__TwigTemplate_fe2d463454c5186a477d8095af318e93->doDisplay(Array, Array) (Line: 360)
Twig\Template->yield(Array) (Line: 335)
Twig\Template->render(Array) (Line: 38)
Twig\TemplateWrapper->render(Array) (Line: 33)
twig_render_template('themes/custom/MY_THEME/templates/layout/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: 475)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 84)
__TwigTemplate_e37fe822a22a1dd04a6b4fc3a715dc00->doDisplay(Array, Array) (Line: 360)
Twig\Template->yield(Array) (Line: 335)
Twig\Template->render(Array) (Line: 38)
Twig\TemplateWrapper->render(Array) (Line: 33)
twig_render_template('themes/custom/MY_THEME/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: 159)
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: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 57)
Drupal\advban\AdvbanMiddleware->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: 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)

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork charts-3461914

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rex.barkdoll created an issue. See original summary.

abhishek_gupta1 made their first commit to this issue’s fork.

abhishek_gupta1’s picture

Status: Active » Needs review

@rex.barkdoll, I have fixed the issue, and created MR please review it once

nikathone’s picture

Version: 5.0.13 » 5.1.x-dev
Status: Needs review » Postponed (maintainer needs more info)

@rex.barkdoll can you try to update to the latest charts version and let us know if you still experiencing this issue?

almador’s picture

After updating the Charts from 5.1.0 to 5.1.2 I noticed a similar problem:

Warning: Undefined array key "connect_nulls" in Drupal\charts\Plugin\views\style\ChartsPluginStyleChart->render() (line 336 of /var/www/html/modules/contrib/charts/src/Plugin/views/style/ChartsPluginStyleChart.php)

here is the related part of the code:

'#connect_nulls' => $chart_settings['display']['connect_nulls'],

what about this solution?

'#connect_nulls' => $chart_settings['display']['connect_nulls'] ?? FALSE,
andileco’s picture

This is addressed in @almador's issue: https://www.drupal.org/project/charts/issues/3499637. For this current issue, let's wait for @rex.barkdoll to respond.

bluegeek9 made their first commit to this issue’s fork.

bluegeek9 changed the visibility of the branch 5.1.x to hidden.

andileco’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing this, as it's been almost 2 years since status was changed to "Postponed (maintainer needs more info)"

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.