From 470fabf894f050e9eb86270fc8530cbd249024aa 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 Signed-off-by: Paola Rossi --- opac/opac-search.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 990cbd0..2fb5790 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -561,6 +561,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; } $hits = 0 unless @newresults; @@ -616,7 +617,7 @@ for (my $i=0;$i<@servers;$i++) { } } - if ($results_hashref->{$server}->{"hits"}){ + if ($hits) { $total = $total + $hits; } -- 1.7.10.4