If you try to set your search results default sort order to "call number" either in the OPAC or the staff client it does not work. It falls back to "relevance." Koha seems to be looking for the values "call_number_asc" or "call_number_dsc" but the preferences template causes the data to be saved as "callnumber_asc" and "callnumber_dsc."
Created attachment 11704 [details] [review] Bug 8657 - Default sort by call number does not work If you choose to sort search results in the OPAC or staff client by call number by default, the wrong value will be saved by the system preferences editor. It should be "call_number" instead of "callnumber." This patch corrects the pref file and updates the database in cases where defaultSortField or OPACdefaultSortField are set to the incorrect value for call number sort. To test: Set defaultSortField and/or OPACdefaultSortField to "call number" and perform a search. Results will be sorted by relevance. Apply the patch, update the database, and search again. Results should now be sorted by call number.
Created attachment 11716 [details] [review] Bug 8657 - Default sort by call number does not work If you choose to sort search results in the OPAC or staff client by call number by default, the wrong value will be saved by the system preferences editor. It should be "call_number" instead of "callnumber." This patch corrects the pref file and updates the database in cases where defaultSortField or OPACdefaultSortField are set to the incorrect value for call number sort. To test: Set defaultSortField and/or OPACdefaultSortField to "call number" and perform a search. Results will be sorted by relevance. Apply the patch, update the database, and search again. Results should now be sorted by call number. Signed-off-by: Liz Rea <wizzyrea@gmail.com> with the caveat that this will not fix the issue unless the sort order is first set to descending and back to ascending per bug 8012. However, with the sort order set to a proper sort value, this patch does fix the issue.
QA Comment: Restore the default value for sorting to "call_number" instead of "callnumber". Caused by a typo (admin/preferences/searching.pref) Marked as Passed QA.
Pushed to 3.8.x will be in 3.8.5
I note that even in 3.08.12.000 the issue reported by Liz Rea still applies, i.e. one needs to set sort order to descending and then back to ascending for the fix to work. I had tried changing sort field (but not the sort order) several times in the past - on each version update - with no luck, and only now noticed her caveat note. Manos Petridis