[Koha-patches] [PATCH] Bug 3945 NULL is not a valid Supplier id

Colin Campbell colin.campbell at ptfs-europe.com
Tue Jan 5 19:29:18 CET 2010


Get SuppliersWithLateIssues should return a list of suppliers
If you have subscriptions with no supplier it also returned a
invalid supplier with a null id and null name.
This patch ignores the non-supplier supplier
---
 C4/Serials.pm |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/C4/Serials.pm b/C4/Serials.pm
index 7d45ea7..03d2e5e 100644
--- a/C4/Serials.pm
+++ b/C4/Serials.pm
@@ -83,6 +83,8 @@ this function get all suppliers with late issues.
 
 return :
 the supplierlist into a hash. this hash containts id & name of the supplier
+Only valid suppliers are returned. Late subscriptions lacking a supplier are
+ignored.
 
 =back
 
@@ -103,6 +105,7 @@ sub GetSuppliersWithLateIssues {
     $sth->execute;
     my %supplierlist;
     while ( my ( $id, $name ) = $sth->fetchrow ) {
+        next if !defined $id;
         $supplierlist{$id} = $name;
     }
     return %supplierlist;
-- 
1.6.5.2




More information about the Koha-patches mailing list