From 2227e59e0c36471254ea09b51e8ca778cd04023f 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 --- 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 4fc4efbe79..8da67e905f 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 2758720cd0..bd1c0d4654 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.11.0