From eaeca1cd4fbdbb92188420c7e6fb6f9bc422b3e3 Mon Sep 17 00:00:00 2001 From: Koha Team Lyon 3 Date: Tue, 25 Oct 2016 13:37:47 +0200 Subject: [PATCH] Bug 17484: Search with date range limit (lower and upper) does not work If the period is entered without spaces wrapping the hyphen You can't get any result Signed-off-by: Mirko Tietgen I can't reproduce the error, search still works after applying the patch Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit 660be0e0195613ce9eaaf45b17d2e5db4ad705f0) Signed-off-by: Julian Maurice --- catalogue/search.pl | 7 +------ opac/opac-search.pl | 6 +----- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index 7ba9cf45c5..59e1bd8078 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -438,12 +438,7 @@ $template->param(available => $available); my $limit_yr; my $limit_yr_value; if ($params->{'limit-yr'}) { - if ($params->{'limit-yr'} =~ /\d{4}-\d{4}/) { - my ($yr1,$yr2) = split(/-/, $params->{'limit-yr'}); - $limit_yr = "yr,st-numeric,ge=$yr1 and yr,st-numeric,le=$yr2"; - $limit_yr_value = "$yr1-$yr2"; - } - elsif ($params->{'limit-yr'} =~ /\d{4}/) { + if ($params->{'limit-yr'} =~ /\d{4}/) { $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 2f42de90b6..0de0de0e9c 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -493,11 +493,7 @@ $template->param(available => $available); # append year limits if they exist if ($params->{'limit-yr'}) { - if ($params->{'limit-yr'} =~ /\d{4}-\d{4}/) { - my ($yr1,$yr2) = split(/-/, $params->{'limit-yr'}); - push @limits, "yr,st-numeric,ge=$yr1 and yr,st-numeric,le=$yr2"; - } - elsif ($params->{'limit-yr'} =~ /\d{4}/) { + if ($params->{'limit-yr'} =~ /\d{4}/) { push @limits, "yr,st-numeric=$params->{'limit-yr'}"; } else {