From a084594357d2f262651b82236d023ea3651c8bb3 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 20 Apr 2017 21:11:22 -0400 Subject: [PATCH] Bug 18467 - Error calling count on undefined bib in basket.pl if order cancelled and record deleted To test: 1 - Create a basket 2 - Order a bib 3 - Cancel order and delete record 4 - You cannot view basket 5 - Apply patch 6 - View basket 7 - There should not be an error r calling count on undefined bib in basket.pl if order cancelled and record deleted Followed test plan and it works as specified Signed-off-by: Alex Buckley --- acqui/basket.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acqui/basket.pl b/acqui/basket.pl index e556be2..d3af492 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -467,8 +467,8 @@ sub get_order_infos { my $countbiblio = CountBiblioInOrders($biblionumber); my $ordernumber = $order->{'ordernumber'}; my @subscriptions = GetSubscriptionsId ($biblionumber); - my $itemcount = $biblio->items->count; - my $holds_count = $biblio->holds->count; + my $itemcount = ( defined $biblio ) ? $biblio->items->count : 0; + my $holds_count = ( defined $biblio ) ? $biblio->holds->count : 0; my @items = GetItemnumbersFromOrder( $ordernumber ); my $itemholds = $biblio ? $biblio->holds->search({ itemnumber => { -in => \@items } })->count : 0; -- 2.1.4