From 50cc36524390c2823e83a3978f3866b19c18e08a Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Tue, 8 Jun 2021 10:43:34 +0200 Subject: [PATCH] Bug 28526: Impossible to search only zero In staff interface and OPAC, searching only zero leads to advanced search page. Test plan : 1) Go to opac home page 2) Enter 0 into search field => Without patch you go to advanced search page => With patch you go to results page 3) Idem on staff interface Signed-off-by: Owen Leonard Signed-off-by: Nick Clemens Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- 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 9552c39089..69ec6c865c 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -169,7 +169,7 @@ my $cgi = CGI->new; my $template_name; my $template_type; my @params = $cgi->multi_param("limit"); -if ((@params>=1) || ($cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) ) { +if ((@params>=1) || (defined $cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) ) { $template_name = 'catalogue/results.tt'; $template_type = 'results'; } diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 878d97826f..e47e6f428b 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -105,7 +105,7 @@ my $format = $cgi->param("format") || ''; if ($format =~ /(rss|atom|opensearchdescription)/) { $template_name = 'opac-opensearch.tt'; } -elsif ((@params>=1) || ($cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) || @searchCategories ) { +elsif ((@params>=1) || (defined $cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) || @searchCategories ) { $template_name = 'opac-results.tt'; } else { -- 2.39.5