I have a View using a Chart format and it works fine using Views 3.0-rc3 when it is displaying only a single node's worth of data. However, I'm trying to sum up totals from several nodes' worth of fields. So I do this by setting Use Aggregation: Yes, then going to each field and setting the aggregation for that field to SUM.
Well, under Views 3.0-rc3 and Chart 7x-1.1, the SUM doesn't work. This is apparently a known issue as reported here. The recommendation in that thread is to update to Views 3.x-dev. Doing so disables the Chart format -- I tried all the choices (Pie, Horizontal Bar, etc) and it never shows.
SUM aggregation works just fine when displayed as a table, so Views is correctly rendering the data. But Charts has an issue.
I've also updated the Chart module to 7.x-1.x-dev. No difference there either.
Comment | File | Size | Author |
---|---|---|---|
#8 | chart-1357454-8.patch | 1.6 KB | zhuber |
Comments
Comment #1
pbeakley CreditAttribution: pbeakley commentedA couple things: bumping this to major -- it's major to me! -- and providing some examples.
First off, I backed this back down to Views7.x-3.0-rc3 (because this apparently is the version where aggregation is fixed). Still using Chart7.x-1.x-dev.
Here's the table version, showing that aggregation is working just fine. The items shown are aggregated from three different nodes, each with a variety of entries. I checked the math and it's fine. Link to the page.
And here's the crazy Chart, showing all the various entries but showing that none of them have been aggregated at all. Link to the chart.
Finally, here's the SQL query generated by Views:
Comment #2
pbeakley CreditAttribution: pbeakley commentedOne last thing: removed the word "fix" from the title -- it's aggregation itself that breaks the Chart.
Comment #3
PolI also have the same problem.
Comment #4
sascher CreditAttribution: sascher commentedsubscribing
Comment #5
PolPlease, stop writing such comments and use the top right button 'subscribe'...
Comment #6
13rac1 CreditAttribution: 13rac1 commentedThis is not Major. See: http://drupal.org/node/45111
Can someone describe how to reproduce this problem? Please write a simple step by step using a fresh Drupal install.
Note: A relevant error message is:
Comment #7
13rac1 CreditAttribution: 13rac1 commentedNo response after five weeks. Please re-open if more information is available.
Comment #8
zhuber CreditAttribution: zhuber commentedThis was definitely an issue, I just updated to the dev version and everything broke. Using aggregation now causes a white screen, which does not allow you to see the errors that are output to drupal.
According to the link you posted from d.o, this is a textbook 'Major' issue:
Here is the error message, for those of you who do not know how to use apache error logging:
PHP Fatal error: Unsupported operand types in /var/www/travel/sites/all/modules/contrib/chart/chart.module on line 489
The issue is that aggregration causes an issue with the _chart_get_max function, which is not expecting the possibility of empty items being in the array. I've patched this with a fix, and also cleaned up a few minor typos in the same function around line 489.
Here are some steps to replicate this issue:
Comment #9
zhuber CreditAttribution: zhuber commentedCan we get this patch tested?
Comment #10
Pierre.Vriens CreditAttribution: Pierre.Vriens commented+1 for #6 and #7, though one might argue about the actual priority (depends who you ask?)
+2 for #8, THAT's how community works! Thanks Zak!
+3 for #9, anybody out there in those +25K sites still using chart who is willing to contribute a (motivated) status update about this issue, ideally "tested by community"?
Note the parent link I now added to push this issue forward somehow. The impact of that link might be that some day this issue becomes a release blocker (which is my current perception of this issue) ...
@pbeakley: consider editing #1 and transform (move) the SQL to an attached txt file which same content ... also: the chart I now see via that "link to chart" seems not that crazy (anymore). Actually it seems to match the table version also now. Maybe you can provide a status update on what happened in between, or what your fix was to resolve it?
To finish, it appears to me that this issue should now have a status like "Needs Review", but also "maintainer needs more info" (related to my questions about #1) . I'll wait for updates regarding the needs review (fingers crossed ...). If that doesn't help, I might want to change the status to "maintainer needs more info".
Comment #11
Pierre.Vriens CreditAttribution: Pierre.Vriens commentedUnless this issue becomes "tested by community" ASAP, it won't make it into the 7.x-1.2 Release (to not put that release at risk). If it still gets tested "on time", it should be included I think. But "on time" now means "in the coming hours/days" ...