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>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Radek Šiman 2019-12-13 16:30:56 +00:00 committed by Martin Renvoize
parent f115158d6d
commit f497008d7f
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -375,6 +375,7 @@ if ($digest_per_branch) {
sth => $sth_digest, sth => $sth_digest,
digests => $digests, digests => $digests,
letter_code => 'PREDUEDGST', letter_code => 'PREDUEDGST',
message_name => 'advance_notice',
branchcode => $branchcode, branchcode => $branchcode,
get_item_info => sub { get_item_info => sub {
my $params = shift; my $params = shift;
@ -393,6 +394,7 @@ if ($digest_per_branch) {
digests => $due_digest, digests => $due_digest,
letter_code => 'DUEDGST', letter_code => 'DUEDGST',
branchcode => $branchcode, branchcode => $branchcode,
message_name => 'item_due',
get_item_info => sub { get_item_info => sub {
my $params = shift; my $params = shift;
$params->{sth}->execute($params->{borrowernumber}, 0); $params->{sth}->execute($params->{borrowernumber}, 0);
@ -407,6 +409,7 @@ if ($digest_per_branch) {
sth => $sth_digest, sth => $sth_digest,
digests => $upcoming_digest, digests => $upcoming_digest,
letter_code => 'PREDUEDGST', letter_code => 'PREDUEDGST',
message_name => 'advance_notice',
get_item_info => sub { get_item_info => sub {
my $params = shift; my $params = shift;
$params->{sth}->execute($params->{borrowernumber}, $params->{sth}->execute($params->{borrowernumber},
@ -421,6 +424,7 @@ if ($digest_per_branch) {
sth => $sth_digest, sth => $sth_digest,
digests => $due_digest, digests => $due_digest,
letter_code => 'DUEDGST', letter_code => 'DUEDGST',
message_name => 'item_due',
get_item_info => sub { get_item_info => sub {
my $params = shift; my $params = shift;
$params->{sth}->execute($params->{borrowernumber}, 0); $params->{sth}->execute($params->{borrowernumber}, 0);
@ -549,7 +553,7 @@ sub send_digests {
C4::Members::Messaging::GetMessagingPreferences( C4::Members::Messaging::GetMessagingPreferences(
{ {
borrowernumber => $borrowernumber, borrowernumber => $borrowernumber,
message_name => 'advance_notice' message_name => $params->{message_name}
} }
); );