From 84831855d24ce640b3cb783a88b4ec805f8944e4 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 4 Aug 2026 10:46:04 +0100 Subject: [PATCH] Bug 39589: (QA follow-up) Don't zero hits when a page has no visible results Zeroing $hits alongside the no_page_results flag also zeroed $total (since $total accumulates $hits, and the final template 'total' param is set from $hits/$total). Because the top "No results found!" banner and the entire search-results section are both gated on 'total' being true, this meant the new no_page_results branch could never actually render: whenever it was true, 'total' was false, so the classic "No results found!" page won instead - recreating the exact bug this patch is meant to fix. Verified against the bug's own test plan (OPACnumSearchResults=5, OpacHiddenItemsHidesRecord, OpacHiddenItems: withdrawn:[1], 6 bibs with the first 5 withdrawn/hidden): before this change, page 1 still showed "No results found!" with no pagination; after this change, it shows "Your search returned 6 results" / "Search results on this page are not available", with a working pagination link to the page containing the visible record. Signed-off-by: Marcel de Rooy Signed-off-by: Pedro Amorim --- opac/opac-search.pl | 1 - 1 file changed, 1 deletion(-) diff --git a/opac/opac-search.pl b/opac/opac-search.pl index a3b4894b15..8bba940881 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -664,7 +664,6 @@ for ( my $i = 0 ; $i < @servers ; $i++ ) { $results_hashref->{$server}->{"RECORDS"}, $variables ); unless (@newresults) { - $hits = 0; $template->param( no_page_results => 1 ); }