From beb8b0f3506d186bb22349d0664f37e35feceb42 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 25 Mar 2019 14:03:16 -0400 Subject: [PATCH] Bug 20457: Overdue and pre-overdue cronjobs not skipping phone notices The overdue and pre-overdue cron scripts are not skipping the generation of phone notices. This causes many phone notices to be created that will always be left at 'pending' as the Talking Tech outbound script creates its own phone notices and puts them in the message queue. Test Plan: 1) Enable Talking Tech 2) Enable predue and overdue notice phone transports for a patron 3) Generate overdues and predues, notice phone notices are generated 4) Apply the patch 5) Repeat steps 2-3 6) Note phone notices are not generated --- misc/cronjobs/advance_notices.pl | 3 +++ misc/cronjobs/overdue_notices.pl | 1 + 2 files changed, 4 insertions(+) diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl index 91bf352b89..d5de56f535 100755 --- a/misc/cronjobs/advance_notices.pl +++ b/misc/cronjobs/advance_notices.pl @@ -285,6 +285,7 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { ## Get branch info for borrowers home library. foreach my $transport ( keys %{$borrower_preferences->{'transports'}} ) { + next if $transport eq 'phone'; my $letter = parse_letter( { letter_code => $letter_type, borrowernumber => $upcoming->{'borrowernumber'}, branchcode => $upcoming->{'branchcode'}, @@ -323,6 +324,7 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { ## Get branch info for borrowers home library. foreach my $transport ( keys %{$borrower_preferences->{'transports'}} ) { + next if $transport eq 'phone'; my $letter = parse_letter( { letter_code => $letter_type, borrowernumber => $upcoming->{'borrowernumber'}, branchcode => $upcoming->{'branchcode'}, @@ -566,6 +568,7 @@ sub send_digests { } foreach my $transport ( keys %{ $borrower_preferences->{'transports'} } ) { + next if $transport eq 'phone'; my $letter = parse_letter( { letter_code => $params->{letter_code}, diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 8c42335c2c..d25b876421 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -678,6 +678,7 @@ END_SQL my $print_sent = 0; # A print notice is not yet sent for this patron for my $mtt ( @message_transport_types ) { + next if $mtt eq 'phone'; my $effective_mtt = $mtt; if ( ($mtt eq 'email' and not scalar @emails_to_use) or ($mtt eq 'sms' and not $data->{smsalertnumber}) ) { # email or sms is requested but not exist, do a print. -- 2.17.2 (Apple Git-113)