Bug 8657 - Default sort by call number does not work
Summary: Default sort by call number does not work
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: 3.8
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Jonathan Druart
Depends on:
Reported: 2012-08-20 14:51 UTC by Owen Leonard
Modified: 2013-12-05 20:06 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:

Bug 8657 - Default sort by call number does not work (2.99 KB, patch)
2012-08-20 15:13 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 8657 - Default sort by call number does not work (3.25 KB, patch)
2012-08-20 21:00 UTC, Liz Rea
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2012-08-20 14:51:14 UTC
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."
Comment 1 Owen Leonard 2012-08-20 15:13:30 UTC Comment hidden (obsolete)
Comment 2 Liz Rea 2012-08-20 21:00:38 UTC
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.
Comment 3 Jonathan Druart 2012-08-21 10:05:11 UTC
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.
Comment 4 Chris Cormack 2012-08-29 21:41:40 UTC
Pushed to 3.8.x will be in 3.8.5
Comment 5 Manos PETRIDIS 2013-05-07 10:41:03 UTC
I note that even in 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