From 2f4d5954c99c7c206d5ccf8f335014fdc1f4723e 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 --- C4/Search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Search.pm b/C4/Search.pm index 454f6d3848..0bf8c6d209 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1597,7 +1597,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