Bug 12922 - Do not DIE the advance_notices.pl -cronjob if "no letter of * type" is found
Summary: Do not DIE the advance_notices.pl -cronjob if "no letter of * type" is found
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Olli-Antti Kivilahti
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
: 12774 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-09-15 15:09 UTC by Olli-Antti Kivilahti
Modified: 2016-06-21 21:36 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 12922 - Do not DIE the advance_notices.pl -cronjob if no letter of type is found!! (2.32 KB, patch)
2014-09-15 15:14 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 12922 - Do not DIE the advance_notices.pl -cronjob if no letter of type is found!! (3.37 KB, patch)
2014-12-15 16:09 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 12922 - Do not DIE the advance_notices.pl -cronjob if no letter of type is found!! (3.43 KB, patch)
2015-01-02 13:57 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED QA] Bug 12922 - Do not DIE the advance_notices.pl -cronjob if no letter of type is found!! (3.50 KB, patch)
2015-01-02 15:22 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Olli-Antti Kivilahti 2014-09-15 15:09:52 UTC
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.
Comment 1 Olli-Antti Kivilahti 2014-09-15 15:14:59 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2014-11-25 16:02:36 UTC
Olli, I agree with your patch.
Could you please provide a test plan?
Comment 3 Olli-Antti Kivilahti 2014-12-15 16:09:21 UTC Comment hidden (obsolete)
Comment 4 Olli-Antti Kivilahti 2014-12-15 16:18:03 UTC
Having this in production for 3+ months already.
Let me know of any bugs ;)
Comment 5 Jonathan Druart 2015-01-02 13:57:54 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2015-01-02 13:59:28 UTC
*** Bug 12774 has been marked as a duplicate of this bug. ***
Comment 7 Kyle M Hall 2015-01-02 15:22:02 UTC
Created attachment 34893 [details] [review]
[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>
Comment 8 Tomás Cohen Arazi 2015-01-10 19:20:27 UTC
Patch pushed to master.

Thanks Olli!
Comment 9 Chris Cormack 2015-01-15 00:34:22 UTC
Pushed to 3.18.x will be in 3.18.3
Comment 10 Mason James 2015-01-16 23:38:10 UTC
Pushed to 3.16.x, will be in 3.16.7