From 55e9a81603711a6022be218dde0d9c1e96cd46f4 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 --- C4/Search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Search.pm b/C4/Search.pm index 0db460a808..8bdf0849c7 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1576,7 +1576,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.30.2