After updating to PHP 8, when using a donut chart, you get this error:

Message TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given in count() (line 193 of .../charts/modules/charts_highcharts/src/Plugin/chart/Highcharts.php

Comments

yojohnyo created an issue. See original summary.

yojohnyo’s picture

StatusFileSize
new723 bytes

This patch seems to fix it.

  • nikathone committed f69c02b1 on 8.x-3.x authored by yojohnyo
    Issue #3306922 by yojohnyo: Donut chart doesn't work after updating to...
nikathone’s picture

Status: Active » Fixed
nikathone’s picture

Status: Fixed » Closed (fixed)
divanova’s picture

Thanks for the patch, @yojohnyo!
I had the same error and this patch fixed it.

divanova’s picture

StatusFileSize
new685 bytes

Actually this patch is not working with version 3.4
I manually made the changes on my local file and I thought that the patch is going to work, but in this version the modified line is a little bit bellow and the patch is failing.

Anyway, I made a new patch which is working with the 3.4 version.