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 <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Martin Renvoize 2026-08-04 10:46:04 +01:00 committed by Pedro Amorim
parent ff26e80dc8
commit 84831855d2
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 0 additions and 1 deletions

View File

@ -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 );
}