Bugzilla – Attachment 107628 Details for
Bug 11469
Publication date range assumes that years must always be 4 digits
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11469: Allow search by publication years with number of digits != 4
Bug-11469-Allow-search-by-publication-years-with-n.patch (text/plain), 1.50 KB, created by
Jonathan Druart
on 2020-07-31 10:08:36 UTC
(
hide
)
Description:
Bug 11469: Allow search by publication years with number of digits != 4
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-07-31 10:08:36 UTC
Size:
1.50 KB
patch
obsolete
>From 704d4fd0e303d04860ea2a75bed9c8f50e02b97a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 31 Jul 2020 12:05:55 +0200 >Subject: [PATCH] Bug 11469: Allow search by publication years with number of > digits != 4 > >The adv search did not allow publication years prior to 1000 >We are now ready for year 10000 > >Test plan: >Having some book with a publication year=123 (3 digits) >Search this book by publication year >=> Search result must return it >--- > catalogue/search.pl | 2 +- > opac/opac-search.pl | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 6e5d929413..0e8cd575b0 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -439,7 +439,7 @@ $template->param(available => $available); > my $limit_yr; > my $limit_yr_value; > if ($params->{'limit-yr'}) { >- if ($params->{'limit-yr'} =~ /\d{4}/) { >+ if ($params->{'limit-yr'} =~ /^\d+$/) { > $limit_yr = "yr,st-numeric=$params->{'limit-yr'}"; > $limit_yr_value = $params->{'limit-yr'}; > } >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index cf2e9e966e..2ea1467973 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -514,7 +514,7 @@ $template->param(available => $available); > > # append year limits if they exist > if ($params->{'limit-yr'}) { >- if ($params->{'limit-yr'} =~ /\d{4}/) { >+ if ($params->{'limit-yr'} =~ /^\d+$/) { > push @limits, "yr,st-numeric=$params->{'limit-yr'}"; > } > else { >-- >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 11469
:
107628
|
107848
|
107939