Bugzilla – Attachment 181527 Details for
Bug 39148
Lists are incorrectly sorted in UNIMARC (OPAC follow-up)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39148: Correct sort by publicationdate in OPAC lists
Bug-39148-Correct-sort-by-publicationdate-in-OPAC-.patch (text/plain), 1.82 KB, created by
Roman Dolny
on 2025-04-25 13:02:58 UTC
(
hide
)
Description:
Bug 39148: Correct sort by publicationdate in OPAC lists
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2025-04-25 13:02:58 UTC
Size:
1.82 KB
patch
obsolete
>From 83b524cec83f7d972d97618c2698933c73dedb7a Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Mon, 17 Feb 2025 17:05:55 +0100 >Subject: [PATCH] Bug 39148: Correct sort by publicationdate in OPAC lists > >Test plan (UNIMARC): >1 - Create a list with different publicationdates, chose to sort it by > copyright gate >2 - Go to the list in the OPAC -> it is not correctly sorted >3 - Pick sort order: copyright date -> not correctly sorted >4 - Apply patch >5 - Retry 2&3 and see it works > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > opac/opac-shelves.pl | 6 ++++++ > 1 file changed, 6 insertions(+) > >diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl >index e7dfc65c58..5f008cb058 100755 >--- a/opac/opac-shelves.pl >+++ b/opac/opac-shelves.pl >@@ -155,6 +155,9 @@ if ( $op eq 'add_form' ) { > $op = $referer; > my $sortfield = $query->param('sortfield'); > $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded ); >+ if ( $sortfield eq 'copyrightdate' and C4::Context->preference('marcflavour') eq 'UNIMARC' ) { >+ $sortfield = 'publicationyear'; >+ } > if ( $shelf->can_be_managed($loggedinuser) ) { > $shelf->shelfname( scalar $query->param('shelfname') ); > $shelf->sortfield($sortfield); >@@ -328,6 +331,9 @@ if ( $op eq 'view' ) { > $sortfield = 'title' > if !$sortfield > or !grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded ); >+ if ( $sortfield eq 'copyrightdate' and C4::Context->preference('marcflavour') eq 'UNIMARC' ) { >+ $sortfield = 'publicationyear'; >+ } > > my $rows; > if ( $query->param('print') or $query->param('rss') ) { >-- >2.39.5
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 39148
:
181500
|
181508
|
181527
|
182257