Did something change between php 5.2.0 and 5.2.6? I can't replicate this problem on piwik.org/demo (5.2.0).
The order of columns between subtables may not be consistent with each other. (Depends on the date range and days.) This is a problem for Csv and Html output where order is critical.
See screenshot where I queried VisitsSummary.get with a date range.
A possible fix is to use ksort() which preseves key-to-value pairings.
I might do some additional investigation into the cause of the re-ordering before fixing the Csv unit tests...
Add test cases to Csv and Html format renderers handling Piwik_DataTable_Array.
The bug was first seen on reports from indonesia diving page which was running 5.1.6
Received in the mail today
Visits export in CSV format has all the data scrambled across columns.
If you look at the XML export, it's obvious that the fields don't always come out in the same order for all records:
This must be the reason why the data in the CSV export is mis-ordered...
matt: can you take a look at this bug? Need a fresh pair of eyes.
(In ) Refs #772 adding test showing that CSV is not affected by the misorder in columns
CSV and HTML renderer are not affected by columns being in random orders, as they print as expected columns in order.
Other reports are affected but this is OK I think, as the data is always clearly labelled and users should not rely on them being always in the same order. If i missed something please reopen
Did we fix this?
I don't know about the random case in comment:12, but the screenshot I took was from my test box. Occassionally, the results were in reverse order.
I couldn't highlight a bug with the CSV or HTML renderer even when elements are in random orders, as the renderer make sure to write data for specific columns in order. If you can replicate a bug, please post full backtrace here.