Bugzilla – Attachment 45070 Details for
Bug 14636
Sorting and searching by publication year in item search doesn't work correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14636: Item search - fix search and sort by publication date for MARC21
Bug-14636-Item-search---fix-search-and-sort-by-pub.patch (text/plain), 1.95 KB, created by
Katrin Fischer
on 2015-11-21 21:46:26 UTC
(
hide
)
Description:
Bug 14636: Item search - fix search and sort by publication date for MARC21
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2015-11-21 21:46:26 UTC
Size:
1.95 KB
patch
obsolete
>From a8af014801473eb64fd1c02b34c0a8d9e5a9c14a Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <Katrin.Fischer.83@web.de> >Date: Sat, 21 Nov 2015 22:32:52 +0100 >Subject: [PATCH] Bug 14636: Item search - fix search and sort by publication > date for MARC21 > >Problem: MARC21/NORMARC stores the publication >date in biblio.copyrightdate, but UNIMARC uses >biblioitems.publicationyear. > >To test: >- Without patch in a MARC21 installation: >- Search by publication date >- Verify that the results don't match the > publication year you searched for. >- Try sorting the table by publication year. >- Verify that the sort doesn't work. >- Apply patch. >- Repeat both, search and sort. >- Verify both work correctly now. >- Repeat tests on a UNIMARC installation. >- Verify both still work. >--- > catalogue/itemsearch.pl | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl >index c1253d7..3cf364c 100755 >--- a/catalogue/itemsearch.pl >+++ b/catalogue/itemsearch.pl >@@ -128,6 +128,9 @@ if (scalar keys %params > 0) { > my $op = shift @op; > if (defined $q and $q ne '') { > if ($i == 0) { >+ if (C4::Context->preference("marcflavor") ne "UNIMARC" && $field eq 'publicationdate') { >+ $field = 'copyrightdate'; >+ } > $f = { > field => $field, > query => $q, >@@ -181,10 +184,15 @@ if (scalar keys %params > 0) { > }; > } > >+ my $sortby = $cgi->param('sortby') || 'itemnumber'; >+ if (C4::Context->preference("marcflavor") ne "UNIMARC" && $sortby eq 'publicationyear') { >+ $sortby = 'copyrightdate'; >+ } >+ warn $sortby; > my $search_params = { > rows => $cgi->param('rows') // 20, > page => $cgi->param('page') || 1, >- sortby => $cgi->param('sortby') || 'itemnumber', >+ sortby => $sortby, > sortorder => $cgi->param('sortorder') || 'asc', > }; > >-- >1.9.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 14636
:
45070
|
45071
|
45120
|
45121
|
45153
|
45161
|
45168
|
45169
|
45304
|
45305
|
45306
|
45307
|
45315
|
45316
|
45317
|
45318
|
45319