Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When viewing a chart (I used Highcharts) the follow notices were logged:
Notice: Undefined index: data_labels in Drupal\charts_highcharts\Charts\HighchartsChartsRender->chartsRenderCharts() (line 161 of web/modules/contrib/charts/modules/charts_highcharts/src/Charts/HighchartsChartsRender.php).
Notice: Undefined index: tooltips in Drupal\charts_highcharts\Charts\HighchartsChartsRender->chartsRenderCharts() (line 166 of web/modules/contrib/charts/modules/charts_highcharts/src/Charts/HighchartsChartsRender.php).
Checks should be added to ensure that the setting are available before using them.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2944101-logged_notices-2.patch | 1.38 KB | John Cook |
Comments
Comment #2
John Cook CreditAttribution: John Cook at Creode commentedI created a patch so that the setting are checked before use.
$plotOptionsSeriesDataLabels->setEnabled($options['data_labels']);
was in all the execution branches so I moved it out to after the check for grouping, and checked for it's presence there.I also fixed a small coding standards bug.
Comment #4
andileco CreditAttribution: andileco at JSI Research & Training Institute, Inc. (JSI) commentedComment #5
andileco CreditAttribution: andileco at JSI Research & Training Institute, Inc. (JSI) commented