Bug 24219: Preserve sort order when returning to result list
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 17 Dec 2019 09:45:11 +0000 (10:45 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 6 Mar 2020 15:01:50 +0000 (15:01 +0000)
commitf1c93e88d4d56bcef05929de70fc86115cbdc463
tree3e573ca6508d4cbea5dd27aa9c79342074c9109b
parent9c2a74a63861543d95c83b2f63a9dc2aeaafd965
Bug 24219: Preserve sort order when returning to result list

There is a mismatch between sort_cgi, sort and sort_by variables.

 * sort_cgi
I did not find relevant occurrences of sort_cgi in the git log of both
search.pl and results.tt. So it seems that it never worked correctly.
 * sort
It is the JS variable use in browser.js
 * sort_by is the search.pl parameter to set the sort_by option

Test plan:
1. Perform a search in the staff client
2. Change the sort order to something different (try Author A-Z)
3. Click on a result to view the record
4. Click on "Results" button on left side to return to result list
=> Without this patch the result list is sorted by relevancy
=> With this patch applied the Author A-Z is kept

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
koha-tmpl/intranet-tmpl/js/browser.js
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt
koha-tmpl/intranet-tmpl/prog/js/pages/results.js