From c1bd87bd02da51f664a5b8bbfb9a02e41f3231ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Radek=20=C5=A0iman?= <rbit@rbit.cz>
Date: Fri, 13 Dec 2019 16:30:56 +0000
Subject: [PATCH] Bug 24235: DUEDGST not sent if PREDUDGST checkbox is off
DUEDGST notice required PREDUEDGST to be on, but both messages have to
be generated independently
Test plan:
0) Do not apply the patch and reproduce the bug
- turn OFF sms PREDUEDGST and turn ON sms DUEDGST for a given borrower
- Sms version of DUEDGST is never generated into the message queue.
1) Apply the patch
2) Ensure that the bug is fixed
Signed-off-by: Michal Denar <black23@gmail.com>
---
misc/cronjobs/advance_notices.pl | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl
index af97c4103b..7c7746cdbf 100755
--- a/misc/cronjobs/advance_notices.pl
+++ b/misc/cronjobs/advance_notices.pl
@@ -375,6 +375,7 @@ if ($digest_per_branch) {
sth => $sth_digest,
digests => $digests,
letter_code => 'PREDUEDGST',
+ message_name => 'advance_notice',
branchcode => $branchcode,
get_item_info => sub {
my $params = shift;
@@ -393,6 +394,7 @@ if ($digest_per_branch) {
digests => $due_digest,
letter_code => 'DUEDGST',
branchcode => $branchcode,
+ message_name => 'item_due',
get_item_info => sub {
my $params = shift;
$params->{sth}->execute($params->{borrowernumber}, 0);
@@ -407,6 +409,7 @@ if ($digest_per_branch) {
sth => $sth_digest,
digests => $upcoming_digest,
letter_code => 'PREDUEDGST',
+ message_name => 'advance_notice',
get_item_info => sub {
my $params = shift;
$params->{sth}->execute($params->{borrowernumber},
@@ -421,6 +424,7 @@ if ($digest_per_branch) {
sth => $sth_digest,
digests => $due_digest,
letter_code => 'DUEDGST',
+ message_name => 'item_due',
get_item_info => sub {
my $params = shift;
$params->{sth}->execute($params->{borrowernumber}, 0);
@@ -549,7 +553,7 @@ sub send_digests {
C4::Members::Messaging::GetMessagingPreferences(
{
borrowernumber => $borrowernumber,
- message_name => 'advance_notice'
+ message_name => $params->{message_name}
}
);
--
2.11.0