From 864040b0e248c9651207386a383ac0c65cd2a6b4 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 12 Aug 2013 15:05:55 -0400 Subject: [PATCH] Bug 8324 - Redisplay OPAC list with correct sort after edit Content-Type: text/plain; charset="utf-8" If you are viewing the contents of a list, edit it, change the default sort, and save your list will be redisplayed sorted by title no matter what default sort you chose. Lists do not automatically sort by their default sort, they must be opened with the sort parameter. This patch adds the list's sort parameter to the redirect after editing. To test, open an existing list in the OPAC which contains items. Click the "Edit list" link at the top of the list contents view. Change the default sort to something new. Click "Save." If the list is redisplayed using the new default sort the patch worked. --- 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 7756d92..90f0f3f 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -200,7 +200,7 @@ sub shelfpage { } if($displaymode eq "viewshelf"){ - print $query->redirect( $pages{$type}->{redirect} . "?viewshelf=$shelfnumber" ); + print $query->redirect( $pages{$type}->{redirect} . "?viewshelf=$shelfnumber" . "&sortfield=" . $shelf->{sortfield}); } elsif($displaymode eq "publicshelves"){ print $query->redirect( $pages{$type}->{redirect} ); } else { -- 1.7.9.5