Bug 18985

Summary: SQL reports 'Last edit' and 'Last run' columns sort alphabetically, not chronologically
Product: Koha Reporter: Nick Clemens <nick>
Component: ReportsAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, katrin.fischer, veron
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19039
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 14365    
Bug Blocks:    
Attachments: Bug 18985 - SQL reports 'Last edit' and 'Last run' columns sort alphabetically, not chronologically
Bug 18985 - SQL reports 'Last edit' and 'Last run' columns sort alphabetically, not chronologically
Bug 18985 - SQL reports 'Last edit' and 'Last run' columns sort alphabetically, not chronologically

Description Nick Clemens 2017-07-26 02:34:34 UTC
To recreate:
Edit and run some reports and then modify the last edited/run dates to be:
7/24/2017 12:12:12
7/25/2016 12:12:12
7/26/2017 12:12:12

Sort by each column and note they will sort in the order above instead of the expected:
7/25/2016 12:12:12
7/24/2017 12:12:12
7/26/2017 12:12:12
Comment 1 Marc Véron 2017-07-28 14:12:06 UTC
Do we have the same with other dates in data tables as well?
Comment 2 Owen Leonard 2017-08-02 12:47:11 UTC
Created attachment 65423 [details] [review]
Bug 18985 - SQL reports 'Last edit' and 'Last run' columns sort alphabetically, not chronologically

This patch alters the DataTables configuration of the SQL reports list
so that date columns are identified via class rather than position.

To test, apply the patch and go to Reports -> Use saved.

Test the re-ordering of the creation date, last edit, and last run
columns. Each should sort correctly based on the date.
Comment 3 Marc Véron 2017-08-04 13:58:08 UTC
(In reply to Marc Véron from comment #1)
> Do we have the same with other dates in data tables as well?

Virtual shelves results (lists) have a 'Date added' column that is not sortable.
Comment 4 Marc Véron 2017-08-04 14:09:58 UTC
Created attachment 65500 [details] [review]
Bug 18985 - SQL reports 'Last edit' and 'Last run' columns sort alphabetically, not chronologically

This patch alters the DataTables configuration of the SQL reports list
so that date columns are identified via class rather than position.

To test, apply the patch and go to Reports -> Use saved.

Test the re-ordering of the creation date, last edit, and last run
columns. Each should sort correctly based on the date.

Signed-off-by: Marc Véron <veron@veron.ch>
Comment 5 Jonathan Druart 2017-08-10 19:08:39 UTC
Created attachment 65849 [details] [review]
Bug 18985 - SQL reports 'Last edit' and 'Last run' columns sort alphabetically, not chronologically

This patch alters the DataTables configuration of the SQL reports list
so that date columns are identified via class rather than position.

To test, apply the patch and go to Reports -> Use saved.

Test the re-ordering of the creation date, last edit, and last run
columns. Each should sort correctly based on the date.

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2017-08-10 19:31:00 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 7 Fridolin Somers 2017-09-29 09:54:39 UTC
Pushed to 17.05.x, will be in 17.05.05.
Comment 8 Katrin Fischer 2017-10-01 21:41:46 UTC
There is no 'Last Run' in 16.11.x as this is a 17.05 feature. Also no 'Last edit'.