From: Henri-Damien LAURENT Date: Tue, 20 Jan 2009 18:46:43 +0000 (+0100) Subject: Prevent multiple warnings per notice filling cron logs. X-Git-Tag: v3.00.01.005~53 X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=3cc561543b2b408148509de97ef3f94c17961396;p=koha.git Prevent multiple warnings per notice filling cron logs. 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 Conflicts: C4/Letters.pm --- diff --git a/C4/Letters.pm b/C4/Letters.pm index 35dc5647a3..9f8a943b2a 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -497,9 +497,7 @@ sub parseletter { $sth->execute; while ( ( my $field ) = $sth->fetchrow_array ) { my $replacefield = "<<$table.$field>>"; - my $replacedby = $values->{$field}; - - # warn "REPLACE $replacefield by $replacedby"; + my $replacedby = $values->{$field} || ''; $letter->{title} =~ s/$replacefield/$replacedby/g; $letter->{content} =~ s/$replacefield/$replacedby/g; }