When viewing a list in the staff client, one can click on the "Call Number" column to have the list sort to call number order. I am noticing that the order does not sort correctly by cn_sort value. For example, we use LC Classification in our library. When clicking the "Call Number" column to sort in ascending order, Koha put these call numbers in this (incorrect) order: - BV4011.3 .W55 2016 - BV5 .W54 1980 - BV811.2 .W44 1980 - BV825.2 .W54 1981 This problem also appears when a list's settings are set to order by call number.
This sounds more like an enhancement request. The sort is done by the DBMS (MySQL/MariaDB) and it will not be trivial to make it sort the results according to the cn_sort.
Why would it not be trivial? It would be just a different column to use? (it's also a sort with SQL)
Created attachment 80990 [details] [review] Bug 21629: Use cn_sort instead of itemcallnumber when displaying a list DBMS can sort callnumbers correctly using cn_sort. We should use it showing a list's content. Test plan: - Add items with callnumber to a list - Display the list - List the content by callnumbers => Confirm that the records are correctly sorted by callnumber
(In reply to Katrin Fischer from comment #2) > Why would it not be trivial? It would be just a different column to use? > (it's also a sort with SQL) Indeed, I was thinking about something else!
Patch tested with a sandbox, by Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Created attachment 81000 [details] [review] Bug 21629: Use cn_sort instead of itemcallnumber when displaying a list DBMS can sort callnumbers correctly using cn_sort. We should use it showing a list's content. Test plan: - Add items with callnumber to a list - Display the list - List the content by callnumbers => Confirm that the records are correctly sorted by callnumber Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
I can confirm that the patch applied to a sandbox sorted a list by call number correctly. I imported some MARC records from my library's catalog into the sandbox that are not sorting correctly in 18.05. They did sort correctly in the sandbox. Yay! Thank you for writing the patch so quickly!! Myka
Thank you Myka for testing!
Created attachment 81292 [details] [review] Bug 21629: Use cn_sort instead of itemcallnumber when displaying a list DBMS can sort callnumbers correctly using cn_sort. We should use it showing a list's content. Test plan: - Add items with callnumber to a list - Display the list - List the content by callnumbers => Confirm that the records are correctly sorted by callnumber Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Awesome work all! Pushed to master for 18.11
Pushed to 18.05.x for 18.05.06.
I prefer to not push to 17.11.x. In case cn_sort calculation is not well configured. I bet it will be better validated during a major version upgrade.