Bugzilla – Attachment 34893 Details for
Bug 12922
Do not DIE the advance_notices.pl -cronjob if "no letter of * type" is found
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 12922 - Do not DIE the advance_notices.pl -cronjob if no letter of type is found!!
PASSED-QA-Bug-12922---Do-not-DIE-the-advancenotice.patch (text/plain), 3.50 KB, created by
Kyle M Hall (khall)
on 2015-01-02 15:22:02 UTC
(
hide
)
Description:
[PASSED QA] Bug 12922 - Do not DIE the advance_notices.pl -cronjob if no letter of type is found!!
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-01-02 15:22:02 UTC
Size:
3.50 KB
patch
obsolete
>From 4f661b4acaa7ed69c497fe8c03bfc06e8bb49390 Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Mon, 15 Sep 2014 11:38:32 +0300 >Subject: [PATCH] [PASSED QA] Bug 12922 - Do not DIE the advance_notices.pl -cronjob if no letter of type is found!! > >We failed to deliver advance_notices because a template for sms's is undefined, because we don't support >sending sms' as advance_notice. >This crashed the cronjob because digests are set to die instead of the warn used in non-digest. >And we get angry customers asking for compensation! > >This patch replaces the die with warn. > >TEST PREPARATION: > >0. Edit the ODUEDGST letter, find an undefined letter for any trasport type. > >TEST PLAN: > >1. Find a borrower and from the messaging preferences set the "Advance notice" transport type to > the undefined digest. Set the "Days in Advance" to 1. >2. Check-out something for that borrower and set the due date for tomorrow. >3. Run "misc/cronjobs/advance_notices.pl -c -n -v" from the terminal. >4. BEFORE THIS PATCH: You get an error > "No circulation PREDUEDGST letter transported by sms at /home/koha/kohaclone/C4/Letters.pm line 609." > and the script dies. >4. AFTER THIS PATCH: You get an error > "No circulation PREDUEDGST letter transported by sms at /home/koha/kohaclone/C4/Letters.pm line 609." > but the script keep on going! > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > misc/cronjobs/advance_notices.pl | 12 ++++++------ > 1 files changed, 6 insertions(+), 6 deletions(-) > >diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl >index 62e36e4..26f87ae 100755 >--- a/misc/cronjobs/advance_notices.pl >+++ b/misc/cronjobs/advance_notices.pl >@@ -266,7 +266,7 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { > message_transport_type => $transport, > } ) > or warn "no letter of type '$letter_type' found. Please see sample_notices.sql"; >- push @letters, $letter; >+ push @letters, $letter if $letter; > } > } > } else { >@@ -302,7 +302,7 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { > message_transport_type => $transport, > } ) > or warn "no letter of type '$letter_type' found. Please see sample_notices.sql"; >- push @letters, $letter; >+ push @letters, $letter if $letter; > } > } > } >@@ -376,8 +376,8 @@ PATRON: while ( my ( $borrowernumber, $digest ) = each %$upcoming_digest ) { > message_transport_type => $transport, > } > ) >- or die "no letter of type '$letter_type' found. Please see sample_notices.sql"; >- push @letters, $letter; >+ or warn "no letter of type '$letter_type' found. Please see sample_notices.sql"; >+ push @letters, $letter if $letter; > } > > if ( @letters ) { >@@ -434,8 +434,8 @@ PATRON: while ( my ( $borrowernumber, $digest ) = each %$due_digest ) { > message_transport_type => $transport, > } > ) >- or die "no letter of type '$letter_type' found. Please see sample_notices.sql"; >- push @letters, $letter; >+ or warn "no letter of type '$letter_type' found. Please see sample_notices.sql"; >+ push @letters, $letter if $letter; > } > > if ( @letters ) { >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12922
:
31614
|
34440
|
34869
| 34893