Bugzilla – Attachment 155883 Details for
Bug 12532
Copy guarantee email to guarantor (or redirect if guarantee has no email set)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12532: (QA follow-up) Fix issues highlighted by unit tests
Bug-12532-QA-follow-up-Fix-issues-highlighted-by-u.patch (text/plain), 2.59 KB, created by
Martin Renvoize (ashimema)
on 2023-09-19 06:49:45 UTC
(
hide
)
Description:
Bug 12532: (QA follow-up) Fix issues highlighted by unit tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-09-19 06:49:45 UTC
Size:
2.59 KB
patch
obsolete
>From b198caf9809bd4298d35c1bd2e9bd9db757bf724 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 18 Sep 2023 16:29:28 +0100 >Subject: [PATCH] Bug 12532: (QA follow-up) Fix issues highlighted by unit > tests > >* YesNo preferences yield '1' or '0' not 'yes' and 'no'. >* Set message_cc address so we can report later that the message went to > a cc address. >--- > C4/Letters.pm | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index f1a5adfca96..dc9385ad345 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -1322,8 +1322,8 @@ sub _send_message_by_email { > my $cc_address; > my @guarantor_address; > my $count_guarantor_address; >- if (C4::Context->preference('RedirectGuaranteeEmail') eq 'yes' && $patron) { >- #Get guanrantor addresses >+ if (C4::Context->preference('RedirectGuaranteeEmail') && $patron) { >+ # Get guarantor addresses > my $guarantor_relationships = $patron->guarantor_relationships; > my @guarantors = $guarantor_relationships->guarantors->as_list; > foreach my $guarantor (@guarantors) { >@@ -1348,7 +1348,7 @@ sub _send_message_by_email { > $to_address = $patron->notice_email_address; > } > if (!$to_address && !$count_guarantor_address) { >- warn "FAIL: No 'to_address', email address or guantors email address for borrowernumber ($message->{borrowernumber})"; >+ warn "FAIL: No 'to_address', email address or guarantors email address for borrowernumber ($message->{borrowernumber})"; > _set_message_status( > { > message_id => $message->{'message_id'}, >@@ -1364,6 +1364,7 @@ sub _send_message_by_email { > } > > $cc_address = join( ',', @guarantor_address ); >+ _update_message_cc_address( $message->{'message_id'}, $cc_address ); > # Skip this message if we exceed domain limits in this run > if( Koha::Notice::Util->exceeds_limit({ to => $to_address, limits => $domain_limits }) ) { > # Save the to_address if you delay the message so that we dont need to look it up again >@@ -1623,6 +1624,12 @@ sub _update_message_from_address { > $dbh->do('UPDATE message_queue SET from_address = ? WHERE message_id = ?', undef, ($from_address, $message_id)); > } > >+sub _update_message_cc_address { >+ my ($message_id, $cc_address) = @_; >+ my $dbh = C4::Context->dbh(); >+ $dbh->do('UPDATE message_queue SET cc_address = ? WHERE message_id = ?', undef, ($cc_address, $message_id)); >+} >+ > sub _set_message_status { > my $params = shift or return; > >-- >2.41.0
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 12532
:
29510
|
30747
|
35313
|
36752
|
39787
|
39925
|
48645
|
53649
|
53689
|
53690
|
53699
|
53700
|
55985
|
56052
|
56053
|
59445
|
59446
|
59447
|
63197
|
64802
|
64824
|
67115
|
68340
|
70865
|
72064
|
72617
|
75099
|
77606
|
80313
|
85134
|
85135
|
87815
|
87816
|
88208
|
88209
|
88210
|
88211
|
88212
|
88213
|
88295
|
88296
|
114455
|
114456
|
114457
|
114458
|
114459
|
114460
|
114461
|
131091
|
131092
|
131093
|
131094
|
149233
|
150071
|
150208
|
150217
|
150240
|
150256
|
151028
|
151029
|
154854
|
154855
|
154856
|
154857
|
155036
|
155037
|
155828
|
155829
|
155830
|
155831
|
155832
|
155833
|
155834
|
155835
|
155836
|
155837
|
155873
|
155874
|
155875
|
155876
|
155877
|
155878
|
155879
|
155880
|
155881
|
155882
|
155883
|
155886
|
155934
|
155935
|
155936
|
155937
|
155938
|
155939
|
155940
|
155941
|
155942
|
155943
|
155944
|
155945
|
155946