Comment 14 for bug 803806

Revision history for this message
David E Drury (david-drury) wrote : Re: Recent changes module sort error

OK,

I think I can see why some people cannot see a problem and others (me!!) can.

1. There is definitely a problem with the sort logic in function print_changes_list (line 1308 in file print_changes_lists.php) that means the sort by date is broken - it actually sorts by the value of the variable $n; this is incremented as each element of the input array is processed.

2. This function is called from the module with the 1st parameter being an array of individual ids that meet the changed date criteria and this array IS ALREADY sorted in descending date order. therefore the broken sort which actually does nothing doesn't matter.

3. If the sort order within the module is changed to "sort by date, oldest first" then the broken sort routine now does wieird things depending on the sequencing of the already sorted array.

I'll try to produce a paper with a sequence of dates that show the problem.

In the mean time, the revised function I attached near the beginning of this bug really does work

Dave