From 4f3b95702bb0d85eea4bba6704252bfe36cf14ff Mon Sep 17 00:00:00 2001 From: Hammat Wele Date: Mon, 26 Aug 2024 17:36:10 +0000 Subject: [PATCH] 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 --- labels/label-item-search.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labels/label-item-search.pl b/labels/label-item-search.pl index 8cebec8278..765119f4f9 100755 --- a/labels/label-item-search.pl +++ b/labels/label-item-search.pl @@ -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}; -- 2.39.5