Bug 30745: Fix error 500 when item is not found while using zebra

Plan test :
- Apply this batch
- Set Zebra as searchEngine
- Go to Cataloging -> # Label creator
- Click on New, Select Label batch
- Click on Add item(s)
- Search for for inexisting items
=> The page should refresh itself (so that it has the same behavior as elasticSearch)

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Hammat Wele 2024-08-26 17:36:10 +00:00 committed by Katrin Fischer
parent b17df14745
commit 6c0b557ea1
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 1 additions and 1 deletions

View File

@ -85,7 +85,7 @@ if ( $op eq "do_search" ) {
undef, undef, $query_type, undef
);
if (!defined $error && @{$results->{biblioserver}{RECORDS}} ) {
if (!defined $error && defined($results) && @{$results->{biblioserver}{RECORDS}} > 0 ) {
$show_results = grep { defined $_ } @{$results->{biblioserver}{RECORDS}};
$marcresults = [ grep { defined $_ } @{$results->{biblioserver}{RECORDS}} ];
$total_hits = $results->{biblioserver}{hits};