Fixed
Project:
Charts
Version:
5.2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Sep 2026 at 21:41 UTC
Updated:
29 Sep 2026 at 18:50 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
liam morlandThis patch is the contents of the merge request.
Comment #4
andileco commentedThank you! Can you investigate the failing test?
Comment #5
liam morlandI think what is happening is that the test chart doesn't have any data. So, with this patch, it returns empty. Previously, it would give a blank chart, but still some chart properties are set. I'm not sure that is what it should do. Maybe the test should be changed. Alternatively, the fix in this issue could be changed so that it still returns the
$chartarray but avoids the error in another way.Comment #6
andileco commentedWould you be able to share more about what you're trying to accomplish so that I can try to replicate in my own environment?
Comment #7
liam morlandI had a View with only one field and the result was a whitescreen TypeError:
A chart needs more than one field but it shouldn't result in a whitescreen if it is setup that way.
Comment #8
andileco commented@liam morland, I wasn't able to replicate your error. Here are the steps I followed:
I opened a view displaying a bar chart (I tried with both Highcharts and Chart.js). It used the title field for the label and two numeric fields as data series.
I removed the two data fields from the view and refreshed the preview. It showed a chart with no data, but nothing threw an error or showed up in the logs.
I opened up the chart settings and clicked apply. That gave me the expected validation error that says that at least one data field must be present.
Can you share your process and how it was different from this?
Comment #9
liam morlandI'm not sure exactly. I was working on an existing site and one of the Views was giving the error message. That View had just one field and the message went away when I added another field. There could have been something else that is off about that View. In any case, it shouldn't give a whitescreen.
Comment #11
nikathoneComment #12
liam morlandThis looks good, though I think the change to
ChartsTestLibrary.phpprobably belongs in its own issue.Comment #13
andileco commented@liam morland - I have updated the MR: this is my preferred solution. Does this work for you?
Comment #14
liam morlandYes
Comment #16
andileco commented