@robocoder opened this Issue on June 9th 2009 Contributor

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.

@robocoder commented on June 9th 2009 Contributor

Attachment:
Screenshot.png

@robocoder commented on June 9th 2009 Contributor

(In [1200]) Fixes #772

@robocoder commented on June 12th 2009 Contributor

I might do some additional investigation into the cause of the re-ordering before fixing the Csv unit tests...

@robocoder commented on June 12th 2009 Contributor

(In [revert 1200), refs #772

@robocoder commented on June 15th 2009 Contributor

Add test cases to Csv and Html format renderers handling Piwik_DataTable_Array.

@mattab commented on August 13th 2009 Owner

The bug was first seen on reports from indonesia diving page which was running 5.1.6

@mattab commented on September 25th 2009 Owner

Received in the mail today

Visits export in CSV format has all the data scrambled across columns.
e.g:
date,nb_uniq_visitors,nb_visits,nb_actions,max_actions,sum_visit_length,bounce_count,nb_visits_converted
2009-08-26,4751,3,0,19,158,31,16

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:
<result date="2009-08-25">
<nb_visits_converted>0</nb_visits_converted>
<bounce_count>3</bounce_count>
<sum_visit_length>6105</sum_visit_length>
<max_actions>26</max_actions>
<nb_actions>189</nb_actions>
<nb_visits>23</nb_visits>
<nb_uniq_visitors>20</nb_uniq_visitors>
</result>

<result date="2009-08-26">
<sum_visit_length>4751</sum_visit_length>
<bounce_count>3</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
<nb_visits>19</nb_visits>
<nb_actions>158</nb_actions>
<max_actions>31</max_actions>
<nb_uniq_visitors>16</nb_uniq_visitors>
</result>

This must be the reason why the data in the CSV export is mis-ordered...

@robocoder commented on October 12th 2009 Contributor

matt: can you take a look at this bug? Need a fresh pair of eyes.

@mattab commented on May 13th 2010 Owner

(In [2178]) Refs #772 adding test showing that CSV is not affected by the misorder in columns

@mattab commented on May 13th 2010 Owner

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

@robocoder commented on May 13th 2010 Contributor

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.

@mattab commented on May 14th 2010 Owner

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.

This Issue was closed on May 14th 2010
Powered by GitHub Issue Mirror