The script members/readingrec.pl specifically requests the users issues ordered with the most recent (by due date) first. But they are displayed in approximately the reverse order to this. The cause is that unless explicitly disabled the datatables sort their data and not being given a specification they do so in ascending order by the first column. The pre display sort of already sorted data needs disabling
Created attachment 17933 [details] [review] proposed patch Patch: to test Without the patch issues in patron circulation history will show oldest first. With patch applied issues will initially display most recent first (ordered by duedate) Users ability to sort the table should not be impaired.
oops forgot to change status
I think the added line should be: "aaSorting": [[8, "desc"]] ...so that the sorted column reflects the sort state in the column header.
(In reply to comment #3) > I think the added line should be: > > "aaSorting": [[8, "desc"]] > > ...so that the sorted column reflects the sort state in the column header. Does this not add an unnecessary re-sort, the data is sorted unless the user selects to resort it no further processing is required
The sorting algorithm doesn't take into account the 'dateformat' system preference. We just have a string sort. It works when dateformat = yyyy/mm/dd. It doesn't for dd/mm/yyyy.
(In reply to comment #5) > The sorting algorithm doesn't take into account the 'dateformat' system > preference. We just have a string sort. It works when dateformat = > yyyy/mm/dd. It doesn't for dd/mm/yyyy. The sort is done by mysql on a mysql date column the koha system preference is not relevant.
Status has been marked as failed QA but I cant see under what basis? Patch is stalled as a result and bug is out in the wild can someone clarify
I set to "Failed QA" because of the issue with the table header sort indicator. I see your point about the forced re-sort. In my tests there was a minor difference in processing time, but I didn't test with an account with a large history (only ~120). The indicator is a minor point, so I'll give the re-sort question the benefit of the doubt and say it's not worth the extra processing.
Created attachment 18383 [details] [review] [SIGNED-OFF] Bug 10184 - Circulation History reverses sort order Issue data is passed to the readingrec template ordered most recent due date first. Datatables unless specified otherwise do a presort on the data they will display the default results in an order the reverse of what was intended. Disabling the presort preserves the initial sort order until the user selects a different sort http://bugs.koha-community.org/show_bug.cgi?id=10184 Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 18410 [details] [review] Bug 10184 - Circulation History reverses sort order Issue data is passed to the readingrec template ordered most recent due date first. Datatables unless specified otherwise do a presort on the data they will display the default results in an order the reverse of what was intended. Disabling the presort preserves the initial sort order until the user selects a different sort Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Pushed to master. Thanks, Colin!
This patch has been pushed to 3.12.x, will be in 3.12.1.
Pushed to 3.10.x, will be in 3.10.7
Pushed to 3.8.x, will be in 3.8.14