Bugzilla – Attachment 123652 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: (QA follow-up) Add comment, remove two defined's
Bug-28764-QA-follow-up-Add-comment-remove-two-defi.patch (text/plain), 2.14 KB, created by
Marcel de Rooy
on 2021-08-09 13:54:16 UTC
(
hide
)
Description:
Bug 28764: (QA follow-up) Add comment, remove two defined's
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-08-09 13:54:16 UTC
Size:
2.14 KB
patch
obsolete
>From 7df31df4c4db26a6b74e194cfed89c68a27d9b02 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 9 Aug 2021 13:41:45 +0000 >Subject: [PATCH] Bug 28764: (QA follow-up) Add comment, remove two defined's >Content-Type: text/plain; charset=utf-8 > >If we no longer offer the sortfield with :asc actively, we should >probably write it somewhere too. >Replaced a few defined tests by empty test. No need to split empty >string or zero etc. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > opac/opac-shelves.pl | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > >diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl >index 167c7648c9..6796691f1f 100755 >--- a/opac/opac-shelves.pl >+++ b/opac/opac-shelves.pl >@@ -260,16 +260,19 @@ if ( $op eq 'view' ) { > if ( $shelf ) { > if ( $shelf->can_be_viewed( $loggedinuser ) ) { > $category = $shelf->category; >+ >+ # Sortfield param may still include sort order with :asc or :desc, but direction overrides it > my( $sortfield, $direction ); >- if( defined( $query->param('sortfield') ) ){ # Passed in sorting overrides default sorting >+ if( $query->param('sortfield') ){ > ( $sortfield, $direction ) = split /:/, $query->param('sortfield'); > } else { > $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 = $query->param('direction') if $query->param('direction'); > $direction = 'asc' if !$direction or ( $direction ne 'asc' and $direction ne 'desc' ); >+ $sortfield = 'title' if !$sortfield or !grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded ); >+ > my ( $page, $rows ); > unless ( $query->param('print') or $query->param('rss') ) { > $rows = C4::Context->preference('OPACnumSearchResults') || 20; >-- >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