From c7763a88b375705e7f33d383192eb561fff2176e 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 | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 617d67e..a0d74a5 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) { @@ -609,8 +610,8 @@ for (my $i=0;$i<@servers;$i++) { } } - if ($results_hashref->{$server}->{"hits"}){ - $total = $total + $results_hashref->{$server}->{"hits"}; + if ($hits) { + $total = $total + $hits; } # Opac search history -- 1.7.2.5