From c88cbf7695ea52e7216bdafb78082b5dcbdcab16 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 Signed-off-by: Chris Cormack --- 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 1243add850..700cca5252 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -669,7 +669,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; } @@ -679,7 +681,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