From bd63b703b31d6383472ed309d4daa20469c5d414 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Mon, 17 May 2021 16:20:41 +0200 Subject: [PATCH] Bug 28365: (Bug 19873 follow-up) Make it possible to search on value 0 Bug 19873 fixed search with value 0. It works in first page but not in other pages. This patch fixes query_cgi var. Test plan: - create a st-numeric index in zebra conf related to a numeric field i.e: yourindex 1=yourindex 4=109 - fill a field with 0 in several biblio records, - reindex your biblios, - search yourindex=0 and go to second page of results, - should not work, - apply this patch, - test again, - should work Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit 14475990626dd16f82b08415b07cf8669ce51a54) Signed-off-by: Fridolin Somers --- C4/Search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Search.pm b/C4/Search.pm index f146902a8e..e52c221778 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1655,7 +1655,7 @@ sub _build_initial_query { $params->{query_cgi} .= "&op=".uri_escape_utf8($operator) if $operator; $params->{query_cgi} .= "&idx=".uri_escape_utf8($params->{index}) if $params->{index}; - $params->{query_cgi} .= "&q=".uri_escape_utf8($params->{original_operand}) if $params->{original_operand}; + $params->{query_cgi} .= "&q=".uri_escape_utf8($params->{original_operand}) if ( $params->{original_operand} ne '' ); #e.g. " and kw,wrdl: test" $params->{query_desc} .= $operator . ( $params->{index_plus} // q{} ) . " " . ( $params->{original_operand} // q{} ); -- 2.39.5