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 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 commentedComment #5
andileco commented