From 3d751067b771051e160e8d834fe346276ec93e12 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 22 Oct 2018 17:02:51 -0300 Subject: [PATCH] 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 Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens (cherry picked from commit 20cba0d2956de5b1ff38b4a5f4b0f620204930e0) Signed-off-by: Martin Renvoize --- opac/opac-shelves.pl | 2 +- virtualshelves/shelves.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl index b2799ea023..c601ea4a95 100755 --- a/opac/opac-shelves.pl +++ b/opac/opac-shelves.pl @@ -243,7 +243,7 @@ if ( $op eq 'view' ) { $rows = C4::Context->preference('OPACnumSearchResults') || 20; $page = ( $query->param('page') ? $query->param('page') : 1 ); } - my $order_by = $sortfield eq 'itemcallnumber' ? 'items.itemcallnumber' : $sortfield; + my $order_by = $sortfield eq 'itemcallnumber' ? 'items.cn_sort' : $sortfield; my $contents = $shelf->get_contents->search( {}, { diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl index 192580f857..6bf3d41727 100755 --- a/virtualshelves/shelves.pl +++ b/virtualshelves/shelves.pl @@ -242,7 +242,7 @@ if ( $op eq 'view' ) { $page = ( $query->param('page') ? $query->param('page') : 1 ); } - my $order_by = $sortfield eq 'itemcallnumber' ? 'items.itemcallnumber' : $sortfield; + my $order_by = $sortfield eq 'itemcallnumber' ? 'items.cn_sort' : $sortfield; my $contents = $shelf->get_contents->search( {}, { -- 2.39.5