From 1f34c499c8bedc260eb07930d59caa97f03f1736 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 8 Nov 2017 17:55:00 +0000 Subject: [PATCH] Bug 19596: Don't try to get hold or items count for non-existent biblios MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Patch applies and works as expected. Signed-off-by: Dilan Johnpullé Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart (cherry picked from commit c42053021bf6f0d5550df5786c8017b90f634ebd) Signed-off-by: Fridolin Somers --- acqui/parcel.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acqui/parcel.pl b/acqui/parcel.pl index 4ba5b5fe30..fdf77657b6 100755 --- a/acqui/parcel.pl +++ b/acqui/parcel.pl @@ -242,8 +242,8 @@ unless( defined $invoice->{closedate} ) { my $countbiblio = CountBiblioInOrders($biblionumber); my $ordernumber = $line{'ordernumber'}; my @subscriptions = GetSubscriptionsId ($biblionumber); - my $itemcount = $biblio->items->count; - my $holds_count = $biblio->holds->count; + my $itemcount = $biblio ? $biblio->items->count : 0; + my $holds_count = $biblio ? $biblio->holds->count : 0; my @items = GetItemnumbersFromOrder( $ordernumber ); my $itemholds = $biblio ? $biblio->holds->search({ itemnumber => { -in => \@items } })->count : 0; -- 2.39.5