From 3747a599f96a35de4e2bf56ab84cde520e34b963 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Mon, 6 Oct 2008 16:53:40 +0200 Subject: [PATCH] Bug Fix : Adding Some error proofs to HaveSubscriptionExpired Date::Calc::CalcDays was throwing error 500 when one serial had an undefined date. Signed-off-by: Henri-Damien LAURENT --- C4/Serials.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index 4ca031299e..ad12dda116 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -1797,8 +1797,10 @@ sub HasSubscriptionExpired { $sth->execute($subscriptionid); my ($res) = $sth->fetchrow ; my @res=split (/-/,$res); -# warn "date expiration :$expirationdate"; my @endofsubscriptiondate=split(/-/,$expirationdate); + map{ + return 2 unless $_ ; + } (@res,@endofsubscriptiondate); return 1 if ( (@endofsubscriptiondate && Delta_Days($res[0],$res[1],$res[2], $endofsubscriptiondate[0],$endofsubscriptiondate[1],$endofsubscriptiondate[2]) <= 0) || (!$res)); -- 2.39.5