From 3cc561543b2b408148509de97ef3f94c17961396 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Tue, 20 Jan 2009 19:46:43 +0100 Subject: [PATCH] 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 --- C4/Letters.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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; } -- 2.39.5