Bug 12100: (follow-up) fix regression
authorGalen Charlton <gmc@esilibrary.com>
Mon, 28 Apr 2014 21:32:45 +0000 (21:32 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 28 Apr 2014 21:36:25 +0000 (21:36 +0000)
This patch fixes a regression on bug 5603 introduced by
the previous patch by ensuring that if no preferred transports are
active for a given message, GetMessagingPreferences()
won't try to populate the transports hash with an undef hash
key.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/Members/Messaging.pm

index 3cb6ae8..6be8347 100644 (file)
@@ -98,6 +98,7 @@ END_SQL
         $return->{'days_in_advance'} = $row->{'days_in_advance'} if defined $row->{'days_in_advance'};
         $return->{'wants_digest'}    = $row->{'wants_digest'}    if defined $row->{'wants_digest'};
         $return->{'letter_code'}     = $row->{'letter_code'};
+        next unless defined $row->{'message_transport_type'};
         $return->{'transports'}->{ $row->{'message_transport_type'} } = $row->{'letter_code'};
     }
     return $return;