From f7dcff2695d9a9b68d4525d0c2d8431f56f01bdf Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 11 Apr 2014 13:44:05 -0400 Subject: [PATCH] Bug 8462 - OpacHiddenItems and hidelostitems hide items, but query result count is off Both OpacHiddenItems and hidelostitems work, and Dobrica's recent patch to remove the numbering if OpacHiddenItems is used is a swell idea (hidelostitems needs that, too!), but in either event, the hit count at the top of the result list is off. Test Plan: 1) Create 5 records with the titles "test 1" through "test 5" with one item each 2) enable hidelostitems 3) Mark one of the items as lost 4) Rebuild your zebra index 5) Search for "test" 6) Note the results count is off 7) Apply this patch 8) Re-run the search 9) Note the results count is now correct --- opac/opac-search.pl | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 617d67e..15f974f 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -555,6 +555,7 @@ for (my $i=0;$i<@servers;$i++) { } else { @newresults = searchResults('opac', $query_desc, $hits, $results_per_page, $offset, $scan, $results_hashref->{$server}->{"RECORDS"}); + $hits = @newresults; } foreach my $res (@newresults) { @@ -610,7 +611,7 @@ for (my $i=0;$i<@servers;$i++) { } if ($results_hashref->{$server}->{"hits"}){ - $total = $total + $results_hashref->{$server}->{"hits"}; + $total = $total + $hits; } # Opac search history -- 1.7.2.5