From fae7c7ec5e7e7f5703858c8f27963263e7bdc210 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. Signed-off-by: David Nind --- 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 15fd6e52d2..5fc966793c 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -617,6 +617,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 @@ -679,7 +680,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.30.2