[Koha-patches] [PATCH] Bug 6236 : When checking for expiry don't try to process 0 dates
Colin Campbell
colin.campbell at ptfs-europe.com
Thu Apr 21 18:11:10 CEST 2011
---
C4/Serials.pm | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/C4/Serials.pm b/C4/Serials.pm
index 1f8c170..20ae7a3 100644
--- a/C4/Serials.pm
+++ b/C4/Serials.pm
@@ -1634,7 +1634,9 @@ sub HasSubscriptionExpired {
my $sth = $dbh->prepare($query);
$sth->execute($subscriptionid);
my ($res) = $sth->fetchrow;
- return 0 unless $res;
+ if (!$res || $res=~m/^0000/) {
+ return 0;
+ }
my @res = split( /-/, $res );
my @endofsubscriptiondate = split( /-/, $expirationdate );
return 2 if ( scalar(@res) != 3 || scalar(@endofsubscriptiondate) != 3 || not check_date(@res) || not check_date(@endofsubscriptiondate) );
--
1.7.4.4
More information about the Koha-patches
mailing list