From c42053021bf6f0d5550df5786c8017b90f634ebd 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 --- acqui/parcel.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/acqui/parcel.pl b/acqui/parcel.pl index c1e0c56eee..b01e591953 100755 --- a/acqui/parcel.pl +++ b/acqui/parcel.pl @@ -242,9 +242,9 @@ unless( defined $invoice->{closedate} ) { my $biblio = Koha::Biblios->find( $biblionumber ); my $countbiblio = CountBiblioInOrders($biblionumber); my $ordernumber = $line{'ordernumber'}; - my $cnt_subscriptions = $biblio->subscriptions->count; - my $itemcount = $biblio->items->count; - my $holds_count = $biblio->holds->count; + my $cnt_subscriptions = $biblio ? $biblio->subscriptions->count: 0; + 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