From 022b2727e926e23e592e31974f0c33e40e28b961 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 12 Sep 2017 12:15:07 -0300 Subject: [PATCH] Bug 18374: (QA followup) Remove warning in Elasticsearch/Search.pm Signed-off-by: Tomas Cohen Arazi --- Koha/SearchEngine/Elasticsearch/Search.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm index cec1cb7..4d584f7 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -148,8 +148,10 @@ sub search_compat { $branches, $query_type, $scan ) = @_; my %options; + if ( !defined $offset or $offset < 0 ) { + $offset = 0; + } $options{offset} = $offset; - $offset = 0 if $offset < 0; $options{expanded_facet} = $expanded_facet; my $results = $self->search($query, undef, $results_per_page, %options); -- 2.7.4