Bug 11489: in OPAC search, display "no results" when the only search result is suppressed

If hidelostitems is enabled, and the result of an opac search is a single
lost item, then the OPAC will display a 404 error, rather than a
"no results" screen.

Test Plan:
1) Catalog a record/item such that it is the only result for some search
   e.g. Give it the title 'zxcvb'
2) Enable hidelostitems
3) Mark this item as lost
4) Perform an OPAC search that should result in a redirect to this record
5) Notice you a redirected to a 404 error
6) Apply this patch
7) Repeat step 4
8) Note you new get a "No results found!" page instead

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Michot <nmichot@voila.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 2277a42c56)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Kyle M Hall 2014-01-07 10:19:37 -07:00 committed by Fridolin Somers
parent 5d5c15f873
commit b3c73cff32
1 changed files with 2 additions and 1 deletions

View File

@ -556,6 +556,7 @@ for (my $i=0;$i<@servers;$i++) {
@newresults = searchResults('opac', $query_desc, $hits, $results_per_page, $offset, $scan,
$results_hashref->{$server}->{"RECORDS"});
}
$hits = 0 unless @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