Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subtable arrays may vary in column ordering #772

Closed
robocoder opened this issue Jun 9, 2009 · 12 comments
Closed

Subtable arrays may vary in column ordering #772

robocoder opened this issue Jun 9, 2009 · 12 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Milestone

Comments

@robocoder
Copy link
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
Copy link
Contributor Author

Attachment:
Screenshot.png

@robocoder
Copy link
Contributor Author

(In [1200]) Fixes #772

@robocoder
Copy link
Contributor Author

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

@robocoder
Copy link
Contributor Author

(In [revert 1200), refs #772

@robocoder
Copy link
Contributor Author

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

@mattab
Copy link
Member

mattab commented Aug 13, 2009

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

@mattab
Copy link
Member

mattab commented Sep 25, 2009

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
Copy link
Contributor Author

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

@mattab
Copy link
Member

mattab commented May 13, 2010

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

@mattab
Copy link
Member

mattab commented May 13, 2010

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
Copy link
Contributor Author

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
Copy link
Member

mattab commented May 14, 2010

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.

@robocoder robocoder added this to the Piwik 0.6.2 milestone Jul 8, 2014
@mattab mattab added the wontfix label Aug 3, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

2 participants