bug 8323 fixing year sorting of a list
authorChris Hall <chrish@catalyst.net.nz>
Thu, 21 Jun 2012 22:36:45 +0000 (10:36 +1200)
committerPaul Poulain <paul.poulain@biblibre.com>
Fri, 6 Jul 2012 15:10:02 +0000 (17:10 +0200)
Signed-off-by: Marc Veron <veron@veron.ch>
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 <paul.poulain@biblibre.com>
C4/VirtualShelves/Page.pm

index f21fd85..c765cf0 100644 (file)
@@ -258,7 +258,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);