Prevent multiple warnings per notice filling cron logs.
authorJoe Atzberger <joe.atzberger@liblime.com>
Fri, 9 Jan 2009 17:15:38 +0000 (11:15 -0600)
committerGalen Charlton <galen.charlton@liblime.com>
Fri, 9 Jan 2009 18:22:30 +0000 (12:22 -0600)
If a value being substituted in was NULL, then warnings like this
would be emailed to the crontab owner (or MAILTO):

Use of uninitialized value in substitution (s///) at /home/user/kohaclone/C4/Letters.pm line 508.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
C4/Letters.pm

index 24f636c..3bcc514 100644 (file)
@@ -502,8 +502,7 @@ sub parseletter {
     $sth->execute;
     while ( ( my $field ) = $sth->fetchrow_array ) {
         my $replacefield = "<<$table.$field>>";
-        my $replacedby   = $values->{$field};
-
+        my $replacedby   = $values->{$field} || '';
         $letter->{title}   =~ s/$replacefield/$replacedby/g;
         $letter->{content} =~ s/$replacefield/$replacedby/g;
     }