From 3f6a77d721a992d78e8ed2cc52ceaf7910700d59 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 11 Jun 2021 17:50:32 +0000 Subject: [PATCH] Bug 28526: (QA follow-up) Don't search if query is blank 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 69ec6c865c..8bd70fc893 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) || (defined $cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) ) { +if ((@params>=1) || (defined $cgi->param("q") && $cgi->param("q") ne "" ) || ($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 e47e6f428b..b03b6d0fbe 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) || (defined $cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) || @searchCategories ) { +elsif ((@params>=1) || (defined $cgi->param("q") && $cgi->param("q") ne "") || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) || @searchCategories ) { $template_name = 'opac-results.tt'; } else { -- 2.39.5