Ticket #772 (new Bug)

Opened 10 months ago

Last modified 3 weeks ago

Subtable arrays may vary in column ordering

Reported by: vipsoft Owned by:
Priority: major Milestone: 1 - Piwik 0.6
Component: Core Keywords:
Cc: Sensitive: no

Description (last modified by vipsoft) (diff)

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.

Attachments

Screenshot.png Download (260.2 KB) - added by vipsoft 10 months ago.

Change History

Changed 10 months ago by vipsoft

Changed 10 months ago by vipsoft

  • status changed from new to closed
  • resolution set to fixed

(In [1200]) Fixes #772

Changed 10 months ago by vipsoft

  • milestone changed from 2- DigitalVibes to 1 - Piwik 0.4.1

Changed 9 months ago by vipsoft

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 9 months ago by vipsoft

  • priority changed from critical to major
  • status changed from reopened to closed
  • resolution set to fixed

Changed 9 months ago by vipsoft

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 9 months ago by vipsoft

  • owner set to vipsoft
  • status changed from reopened to new

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

Changed 9 months ago by vipsoft

(In [1209]) revert [1200], refs #772

Changed 9 months ago by vipsoft

  • milestone changed from 1 - Piwik 0.4.1 to 2- DigitalVibes

Changed 9 months ago by vipsoft

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

Changed 7 months ago by matt

  • sensitive unset
  • milestone changed from 2- DigitalVibes to 2 - Piwik 0.5

Changed 6 months ago by vipsoft

  • owner vipsoft deleted

Changed 6 months ago by matt

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...

Changed 6 months ago by matt

  • milestone changed from 2 - Piwik 0.5 to 1 - Piwik 0.4.4

Changed 6 months ago by LucidMind

Changed 5 months ago by vipsoft

  • description modified (diff)

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

Changed 5 months ago by vipsoft

  • milestone changed from 1 - Piwik 0.5 to 2 - Piwik 0.6

Changed 4 months ago by vipsoft

  • milestone changed from 1 - Piwik 0.5 to 1 - Piwik 0.5.1

Changed 3 weeks ago by matt

  • milestone changed from 1 - Piwik 0.5.5 to 1 - Piwik 0.5.6
Note: See TracTickets for help on using tickets.