Bug 3945 NULL is not a valid Supplier id
authorColin Campbell <colin.campbell@ptfs-europe.com>
Tue, 5 Jan 2010 18:29:18 +0000 (18:29 +0000)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 6 Jan 2010 16:01:49 +0000 (17:01 +0100)
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

index 7d45ea7..03d2e5e 100644 (file)
@@ -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;