Bugzilla – Attachment 123207 Details for
Bug 28764
Sorting not correct in pagination on OPAC lists
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28764: Parse direction parameter in public list view
Bug-28764-Parse-direction-parameter-in-public-list.patch (text/plain), 1.64 KB, created by
Owen Leonard
on 2021-07-27 11:49:17 UTC
(
hide
)
Description:
Bug 28764: Parse direction parameter in public list view
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-07-27 11:49:17 UTC
Size:
1.64 KB
patch
obsolete
>From 38f1535afae37c90132eedb91767c0f720e873d1 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 27 Jul 2021 11:27:21 +0000 >Subject: [PATCH] Bug 28764: Parse direction parameter in public list view > >This patch adds a check for a 'direction' paramter in list sorting. > >It maintains the existing syntax for sorting 'sortfield=field:direction' >but adds support for the form used in paginations and more commonly thtoughout >Koha' sortfield=field&direction=direction' > >To test: >1 - Create a public list >2 - Add enough items to generate two pages (40 worked for me) >3 - View the list and enforce sorting by date added descending: > sortfield=dateadded:desc >4 - Note the titles shown >5 - Click to second page using the pagination bar >6 - Note the same titles are shown, in a reversed order >7 - Apply patch >8 - repeat 305 >9 - Second page is sorted correctly! > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > opac/opac-shelves.pl | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl >index 8bca2f7d00..167c7648c9 100755 >--- a/opac/opac-shelves.pl >+++ b/opac/opac-shelves.pl >@@ -267,6 +267,7 @@ if ( $op eq 'view' ) { > $sortfield = $shelf->sortfield; > $direction = 'asc'; > } >+ if( defined( $query->param('direction') ) ){ $direction = $query->param('direction'); } > $sortfield = 'title' if !$sortfield or !grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded ); > $direction = 'asc' if !$direction or ( $direction ne 'asc' and $direction ne 'desc' ); > my ( $page, $rows ); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28764
:
123205
|
123207
|
123297
|
123650
|
123651
|
123652