From 703b97f22d62ac7d25981a0449196fbe5b90aec1 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 6 Jan 2017 12:21:56 +0100 Subject: [PATCH] Bug 17736: [QA Follow-up] Crashes in basket.pl and parcel.pl Crash in basket.pl: Can't call method "holds" on an undefined value at /usr/share/koha/masterclone/acqui/basket.pl line 466. Comes from a biblionumber == NULL in aqorders where I cancelled the order and deleted the biblio. Crash in parcel.pl: Can't call method "holds" on an undefined value at /usr/share/koha/masterclone/acqui/parcel.pl line 246. Similar fix. Trivial fixes indeed. Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall --- acqui/parcel.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acqui/parcel.pl b/acqui/parcel.pl index b4421e5d52..fbd376f24e 100755 --- a/acqui/parcel.pl +++ b/acqui/parcel.pl @@ -141,11 +141,11 @@ for my $order ( @orders ) { $line{holds} = 0; my @itemnumbers = GetItemnumbersFromOrder( $order->{ordernumber} ); my $biblio = Koha::Biblios->find( $line{biblionumber} ); - $line{holds} = $biblio->current_holds->search( + $line{holds} = $biblio ? $biblio->current_holds->search( { itemnumber => { -in => \@itemnumbers }, } - )->count; + )->count : 0; $line{budget} = GetBudgetByOrderNumber( $line{ordernumber} ); $line{tax_value} = $line{tax_value_on_receiving}; -- 2.39.5