From 4abe3a4082c8fc28b99b2d54825442d2328b4eef Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 8 Nov 2018 01:50:34 +0000 Subject: [PATCH] Bug 18316: (follow-up) Don't let 'fields' be undef and adjust tests Signed-off-by: Nick Clemens --- Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 2 +- t/db_dependent/www/search_utf8.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm index fd98c3615b..57836e9d8c 100644 --- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm +++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm @@ -92,7 +92,7 @@ sub build_query { default_operator => 'AND', default_field => '_all', lenient => JSON::true, - fields => $options{fields}, + fields => $options{fields} || [], } }; diff --git a/t/db_dependent/www/search_utf8.t b/t/db_dependent/www/search_utf8.t index 3b3c22f9b5..85a227a053 100644 --- a/t/db_dependent/www/search_utf8.t +++ b/t/db_dependent/www/search_utf8.t @@ -266,7 +266,7 @@ sub test_search{ $intra_text = $agent->text(); like( $intra_text, qr|Publisher: $publisher|, ); - my $expected_base = q|search.pl\?idx=kw&q=| . uri_escape_utf8( $publisher ); + my $expected_base = q|search.pl\?advsearch=1&idx=kw&q=| . uri_escape_utf8( $publisher ); $agent->base_like(qr|$expected_base|, ); ok ( ( length(Encode::encode('UTF-8', $intra_text)) != length($intra_text) ) , 'UTF-8 are multi-byte. Good') ; -- 2.39.5