Bug 12922 - Do not DIE the advance_notices.pl -cronjob if no letter of type is found!!
authorOlli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Mon, 15 Sep 2014 08:38:32 +0000 (11:38 +0300)
committerChris Cormack <chris@bigballofwax.co.nz>
Thu, 15 Jan 2015 00:33:34 +0000 (13:33 +1300)
commit278e76fb8a651d518833ed2b34fad7f1d3f7f5dd
treea78ecac236964c774ee5b9926844e89e0a40cdad
parent23e2ded850175bedb89da06159a465f8928ce588
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 9d53118f55f0f278a22f846af510edb7fa4477be)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
misc/cronjobs/advance_notices.pl