From cb9c6415840153397580a26b156c4eed85e469a0 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 17 Dec 2014 06:11:09 -0500 Subject: [PATCH] Bug 12774 - Enabling phone notices ( talking tech ) without having DUEDGST and PREDUEDGST breaks advance notices! If talking tech is enabled, and a patron has selected phone notices for predue and/or due notices, advance_notices will die when coming upon a patron with phone notices selected. The TT script for advance notices does not use a letter and thus no letter exists for it by default. When advance_notices comes upone this, it sees the phone transport, tries to get the notices for the phone transport, and dies. Test Plan: 1) Enable TalkingTech 2) Set one or more patrons to recieve advance notices via phone 3) Set one or more patrons so they should recieve an advance notice today 4) Run advance_notices.pl, note that it dies 5) Apply this patch 6) Run advance_notices.pl, note that it now warns instead of dying --- misc/cronjobs/advance_notices.pl | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl index 62e36e4..83c28e8 100755 --- a/misc/cronjobs/advance_notices.pl +++ b/misc/cronjobs/advance_notices.pl @@ -375,9 +375,14 @@ PATRON: while ( my ( $borrowernumber, $digest ) = each %$upcoming_digest ) { branchcode => $branch_info{"branches.branchcode"}, message_transport_type => $transport, } - ) - or die "no letter of type '$letter_type' found. Please see sample_notices.sql"; - push @letters, $letter; + ); + + if ($letter) { + push @letters, $letter; + } + else { + warn "No letter of type '$letter_type' found. Please see sample_notices.sql"; + } } if ( @letters ) { -- 1.7.2.5