[Koha-patches] [PATCH] (bug #4044) don't trap fatal error if there is no start date

Nahuel ANGELINETTI nahuel.angelinetti at biblibre.com
Thu Jan 14 16:35:12 CET 2010


this fix GetExpirationDate that trap a fatal error if the subscription have not any start date.
---
 C4/Serials.pm |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/C4/Serials.pm b/C4/Serials.pm
index fdf15e1..2f5f27f 100644
--- a/C4/Serials.pm
+++ b/C4/Serials.pm
@@ -1011,7 +1011,9 @@ sub GetExpirationDate {
     my $dbh              = C4::Context->dbh;
     my $subscription     = GetSubscription($subscriptionid);
     my $enddate          = $subscription->{startdate};
-
+    
+    return if not $subscription->{startdate};
+    
 # we don't do the same test if the subscription is based on X numbers or on X weeks/months
     if (($subscription->{periodicity} % 16) >0){
       if ( $subscription->{numberlength} ) {
-- 
1.6.3.3




More information about the Koha-patches mailing list