From 4d35106b44940a75d2b1b3343ca3747d7bbd3537 Mon Sep 17 00:00:00 2001 From: Chris Hall Date: Fri, 22 Jun 2012 10:36:45 +1200 Subject: [PATCH] Bug 8323 fixing year sorting of a list Signed-off-by: Marc Veron Works as expected. Caveat: If you edit the list in Opac, change the sort and then klick 'Save', the List always is displayed in title order. This is du to the fact that save calls opac-shelves.pl?viewshelf=4 without the sort parameter (defaults to 'title'). If you go back to lists, choose the list from List name, the param is correct and the list displays in expected order. It took quite a time to track that down, I first thought that opac-shelves.pl was broken. However, current bug 8323 is not affected, signing off. Marc Signed-off-by: Paul Poulain Signed-off-by: Chris Cormack (cherry picked from commit 2b8b926783d4426d4a569fdc717e546d12e88ce5) Signed-off-by: Jared Camins-Esakov --- C4/VirtualShelves/Page.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index cfa4f60c00..903ec54a75 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -203,7 +203,7 @@ sub shelfpage ($$$$$) { if ( $sortfield eq 'year' ) { $yearsort = 'year'; } - ( $items, $totitems ) = GetShelfContents( $shelfnumber, $shelflimit, $shelfoffset ); + ( $items, $totitems ) = GetShelfContents( $shelfnumber, $shelflimit, $shelfoffset, $sortfield eq 'year' ? 'copyrightdate' : $sortfield ); for my $this_item (@$items) { my $biblionumber = $this_item->{'biblionumber'}; my $record = GetMarcBiblio($biblionumber); -- 2.39.5