Bug 16951

Summary: Item search sorting not working properly for most columns
Product: Koha Reporter: Nick Clemens <nick>
Component: SearchingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: jonathan.druart, jschmidt, julian.maurice, katrin.fischer, kyle, mtj, tmisilo
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:
Attachments: Bug 16951: Fix Item search sorting
Bug 16951: Replace some more
Bug 16951: Fix Item search sorting
Bug 16951: Replace some more
Bug 16951: Fix Item search sorting
Bug 16951: Replace some more

Description Nick Clemens 2016-07-21 01:37:31 UTC
When I pull up items in the item search and arrange by title, publication year, publisher, itemcallnumber, etc. I am getting results that don't seem to make any sense.

I am seeing reports of this in 3.22.8 as well

The order seems to be the same no matter what column, and it almost appears as if they are being ordered by date accessioned
Comment 1 Tom Misilo 2016-07-21 12:52:50 UTC
This seems to be a regression from 3.18, as we were able to sort on call numbers before.
Comment 2 Katrin Fischer 2016-12-14 20:16:44 UTC
Yes, I am pretty sure too that this worked in 3.18 - as a regression I am upping severity a bit.
Comment 3 Jonathan Druart 2016-12-16 10:43:14 UTC
Created attachment 58243 [details] [review]
Bug 16951: Fix Item search sorting

Caused by
  commit ac5a1bfececb5400a77f0ebad90181f5215d5a85
    Bug 16154: CGI->multi_param - Manual changes

The change was wrong, we wanted to retrieve a scalar (the string), not
an array.
We want to retrieve a string with the different column' names, not an
array of 1 element.

Test plan:
Launch an item search and play with column sort
Comment 4 Jonathan Druart 2016-12-16 10:43:18 UTC
Created attachment 58244 [details] [review]
Bug 16951: Replace some more

In order to avoid warnings in the logs, $cgi->param should be forced to
scalar context
Comment 5 Katrin Fischer 2016-12-22 12:58:06 UTC
Created attachment 58381 [details] [review]
Bug 16951: Fix Item search sorting

Caused by
  commit ac5a1bfececb5400a77f0ebad90181f5215d5a85
    Bug 16154: CGI->multi_param - Manual changes

The change was wrong, we wanted to retrieve a scalar (the string), not
an array.
We want to retrieve a string with the different column' names, not an
array of 1 element.

Test plan:
Launch an item search and play with column sort

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2016-12-22 13:01:14 UTC
Created attachment 58382 [details] [review]
Bug 16951: Replace some more

In order to avoid warnings in the logs, $cgi->param should be forced to
scalar context

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Nick Clemens 2016-12-22 13:34:10 UTC
Created attachment 58384 [details] [review]
Bug 16951: Fix Item search sorting

Caused by
  commit ac5a1bfececb5400a77f0ebad90181f5215d5a85
    Bug 16154: CGI->multi_param - Manual changes

The change was wrong, we wanted to retrieve a scalar (the string), not
an array.
We want to retrieve a string with the different column' names, not an
array of 1 element.

Test plan:
Launch an item search and play with column sort

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 8 Nick Clemens 2016-12-22 13:34:15 UTC
Created attachment 58385 [details] [review]
Bug 16951: Replace some more

In order to avoid warnings in the logs, $cgi->param should be forced to
scalar context

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 9 Kyle M Hall 2016-12-22 13:42:41 UTC
Pushed to master for 17.05, thanks Jonathan!
Comment 10 Katrin Fischer 2016-12-22 19:27:21 UTC
These patches have been pushed to 16.11.x, will be in 16.11.01.
Comment 11 Julian Maurice 2017-01-02 11:49:16 UTC
Pushed to 3.22.x for 3.22.14
Comment 12 Mason James 2017-01-29 11:43:33 UTC
Pushed to 16.05.x, for 16.05.07 release