Ticket #772 (closed Bug: invalid)

Opened 3 years ago

Last modified 21 months ago

Subtable arrays may vary in column ordering

Reported by: vipsoft Owned by:
Priority: normal Milestone: Piwik 0.6.2
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 3 years ago.

Change History

Changed 3 years ago by vipsoft

Changed 3 years ago by vipsoft

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

(In [1200]) Fixes #772

Changed 3 years ago by vipsoft

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

Changed 3 years ago by vipsoft

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 3 years ago by vipsoft

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

Changed 3 years ago by vipsoft

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 3 years 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 3 years ago by vipsoft

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

Changed 3 years ago by vipsoft

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

Changed 3 years ago by vipsoft

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

Changed 2 years ago by matt

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

Changed 2 years ago by vipsoft

  • owner vipsoft deleted

Changed 2 years 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 2 years ago by matt

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

Changed 2 years ago by LucidMind

Changed 2 years ago by vipsoft

  • description modified (diff)

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

Changed 2 years ago by vipsoft

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

Changed 2 years ago by vipsoft

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

Changed 2 years ago by matt

  • milestone changed from 1 - Piwik 0.5.5 to 1 - Piwik 0.5.6

Changed 23 months ago by vipsoft

  • priority changed from major to normal

Changed 21 months ago by matt

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

Changed 21 months ago by matt

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

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

Changed 21 months ago by vipsoft

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.

Changed 21 months ago by matt

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.

Note: See TracTickets for help on using tickets.