From 252531956831629b59878786baeacea67f75f024 Mon Sep 17 00:00:00 2001 From: Hammat Wele Date: Fri, 23 Aug 2024 20:24:14 +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) --- labels/label-item-search.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/labels/label-item-search.pl b/labels/label-item-search.pl index 8cebec8278..6586fa9c40 100755 --- a/labels/label-item-search.pl +++ b/labels/label-item-search.pl @@ -42,6 +42,8 @@ my $op = $query->param('op') || ''; my $batch_id = $query->param('batch_id'); my @limits = split(" AND ", $query->param('limits') || ""); my $startfrom = $query->param('startfrom') || 1; +Koha::Logger->get->warn('$batch_id'); +Koha::Logger->get->warn($batch_id); my ($template, $loggedinuser, $cookie) = (undef, undef, undef); my ( $total_hits, $total, $error, @@ -85,7 +87,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.34.1