From 0266174c96b8b1b26b32b432dc63b585ab86d330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rard=20Simon=20Voyer?= Date: Fri, 7 May 2021 19:51:51 +0000 Subject: [PATCH] Bug 17787: Hidden items included in count of search results opac-search.pl does not consider items hidden by OpacHiddenItems in the search count. This attachment aims at fixing the count for visual harmony, since the bug lives on but is only reported in cases where the results count is greater than the value of results_per_page. --- opac/opac-search.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 26ec1cca9e..f4950bb001 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -692,6 +692,7 @@ for (my $i=0;$i<@servers;$i++) { $art_req_itypes = Koha::CirculationRules->guess_article_requestable_itemtypes({ $patron ? ( categorycode => $patron->categorycode ) : () }); } + my $results_count = scalar @newresults; foreach my $res (@newresults) { # must define a value for size if not present in DB @@ -754,7 +755,9 @@ for (my $i=0;$i<@servers;$i++) { } if ($results_hashref->{$server}->{"hits"}){ - $total = $total + $hits; + if ($hits > $results_per_page) { + $total = $total + $hits; + } else { $total = $results_count } } # Opac search history -- 2.11.0