PHP 8.2 error on chart type

Created on 21 November 2023, 12 months ago
Updated 20 June 2024, 5 months ago

Problem/Motivation

When rendering a pie chart (or likely any other type of chart) using PHP 8.2, you get the attached error message. This is due to a deprecation within PHP 8.2 about dynamic properties: https://php.watch/versions/8.2/dynamic-properties-deprecated

The error appears to occur here: (line 28 of modules/contrib/charts/modules/charts_highcharts/src/Settings/Highcharts/PlotOptions.php)

Steps to reproduce

Using PHP 8.2 try to render a chart using the highcharts module. You should see a deprecation error message being displayed/logged to the log messages.

Proposed resolution

There are a couple of approaches to take here, one may require a significant refactor for how the highchart is creating types, whereas the other would be a workaround to allow dynamic properties by using the Allow Dynamic Properties https://www.php.net/manual/en/class.allowdynamicproperties.php attribute.

🐛 Bug report
Status

Active

Version

3.5

Component

Highcharts integration

Created by

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

Comments & Activities

Production build 0.71.5 2024