From f151ce91ccb6eac7cf8a35dcc5e614181ee601f1 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 follow-up) Remove warning in Elasticsearch/Search.pm Signed-off-by: Tomas Cohen Arazi Signed-off-by: Julian Maurice Signed-off-by: Jonathan Druart (cherry picked from commit cfa1aac9554ea9cba09aec30a4b1f85c09cb5f63) Signed-off-by: Fridolin Somers --- 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 cec1cb7fb6..4d584f7906 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.39.5