Bug 28069

Summary: Can't sort lists on staff client
Product: Koha Reporter: Séverine Queune <severine.queune>
Component: ListsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Kyle M Hall <kyle>
Severity: normal    
Priority: P5 - low CC: andrewfh, esther.melander, fridolin.somers, george, kyle, m.de.rooy, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.05,20.05.11
Bug Depends on: 27715    
Bug Blocks: 28105    
Attachments: Bug 28069: (bug 27715 follow-up) Fix sort for lists
Bug 28069: (bug 27715 follow-up) Fix sort for lists
Bug 28069: (bug 27715 follow-up) Fix sort for lists

Description Séverine Queune 2021-04-01 13:43:32 UTC
On staff client, it's not possible to sort lists by 'Contents'.
Comment 1 Owen Leonard 2021-04-05 13:42:58 UTC
In my test it's not possible to sort by ANY column!
Comment 2 Owen Leonard 2021-04-05 15:08:13 UTC
git bisect blames Bug 27715 - Possibly SQL injection in virtualshelves
Comment 3 Jonathan Druart 2021-04-06 15:38:13 UTC
Created attachment 119226 [details] [review]
Bug 28069: (bug 27715 follow-up) Fix sort for lists

Sort functionality has been broken by bug 27715. We need to specify the
table.column in the datatable init

Note that "count" needs to be handled separately (which is a bit dirty
but cannot find something better)

Test plan:
Create some lists, add contents, change owner and dates
Sort using the different attributes and confirm that it's now working
Comment 4 Séverine Queune 2021-04-06 15:49:18 UTC
Is the "Owner" sort using the borrowernumber instead of borrower's name the excepted behaviour ?
Comment 5 Séverine Queune 2021-04-06 15:49:40 UTC
Is the "Owner" sort using the borrowernumber instead of borrower's name the excepted behaviour ?
Comment 6 Jonathan Druart 2021-04-06 16:07:04 UTC
Absolutely not. However it seems that it was the behaviour pre bug 27715, so it should be addressed on its own bug report.
Comment 7 Séverine Queune 2021-04-07 08:54:15 UTC
Created attachment 119262 [details] [review]
Bug 28069: (bug 27715 follow-up) Fix sort for lists

Sort functionality has been broken by bug 27715. We need to specify the
table.column in the datatable init

Note that "count" needs to be handled separately (which is a bit dirty
but cannot find something better)

Test plan:
Create some lists, add contents, change owner and dates
Sort using the different attributes and confirm that it's now working

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 8 Séverine Queune 2021-04-07 08:57:21 UTC
(In reply to Jonathan Druart from comment #6)
> Absolutely not. However it seems that it was the behaviour pre bug 27715, so
> it should be addressed on its own bug report.

Thank you Jonathan !
I opened bug 28105 to fix that issue.
Comment 9 Kyle M Hall 2021-04-16 14:03:26 UTC
Created attachment 119743 [details] [review]
Bug 28069: (bug 27715 follow-up) Fix sort for lists

Sort functionality has been broken by bug 27715. We need to specify the
table.column in the datatable init

Note that "count" needs to be handled separately (which is a bit dirty
but cannot find something better)

Test plan:
Create some lists, add contents, change owner and dates
Sort using the different attributes and confirm that it's now working

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Jonathan Druart 2021-04-16 14:31:33 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 11 Fridolin Somers 2021-04-22 14:38:11 UTC
Pushed to 20.11.x for 20.11.05
Comment 12 Andrew Fuerste-Henry 2021-04-25 16:56:39 UTC
Pushed to 20.05.x for 20.05.11
Comment 13 Victor Grousset/tuxayo 2021-04-25 20:49:15 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.
Comment 14 Katrin Fischer 2022-07-17 10:44:00 UTC
*** Bug 29045 has been marked as a duplicate of this bug. ***