[Koha-patches] [PATCH] Prevent multiple warnings per notice filling cron logs.

Joe Atzberger joe.atzberger at liblime.com
Fri Jan 9 18:15:38 CET 2009


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.
---
 C4/Letters.pm |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/C4/Letters.pm b/C4/Letters.pm
index 24f636c..3bcc514 100644
--- a/C4/Letters.pm
+++ b/C4/Letters.pm
@@ -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;
     }
-- 
1.5.5.GIT




More information about the Koha-patches mailing list