From dd5023e6d469961b533fb51f02e22ac434d9790c Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 12 Dec 2012 02:43:29 +1300 Subject: [PATCH] Bug 8299 - overdue_notice.pl shows error messages fixes 2 warnings... Use of uninitialized value in pattern match (m//) at /usr/share/koha/bin/cronjobs/overdue_notices.pl line 659. Use of uninitialized value in pattern match (m//) at /usr/share/koha/bin/cronjobs/overdue_notices.pl line 670. Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart Signed-off-by: Jared Camins-Esakov --- misc/cronjobs/overdue_notices.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 737fa34b4b..614ff60d47 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -679,7 +679,9 @@ sub parse_letter { } my $currency_format; - if ($params->{'letter'}->{'content'} =~ m/(.*)<\/fine>/o) { # process any fine tags... + if ( defined $params->{'letter'}->{'content'} + and $params->{'letter'}->{'content'} =~ m/(.*)<\/fine>/o ) + { # process any fine tags... $currency_format = $1; $params->{'letter'}->{'content'} =~ s/.*<\/fine>/<>/o; } @@ -689,7 +691,7 @@ sub parse_letter { my $item_format = ''; foreach my $item (@$i) { my $fine = GetFine($item->{'itemnumber'}, $params->{'borrowernumber'}); - if (!$item_format) { + if ( !$item_format and defined $params->{'letter'}->{'content'} ) { $params->{'letter'}->{'content'} =~ m/(.*<\/item>)/; $item_format = $1; } -- 2.39.5