From 8b10335defcc5a5a39fd792878079983504944e7 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Wed, 19 Nov 2008 14:58:18 +0100 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: Galen Charlton --- C4/Serials.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index 443c3612ae..90db643af3 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -1805,8 +1805,10 @@ sub HasSubscriptionExpired { my ($res) = $sth->fetchrow ; return 0 unless $res; 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