Bugzilla – Attachment 122139 Details for
Bug 28581
Patron's queue_notice uses inbound_email_address incorrectly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28581: Use 'from_email_address' where appropriate
Bug-28581-Use-fromemailaddress-where-appropriate.patch (text/plain), 6.81 KB, created by
Nick Clemens (kidclamp)
on 2021-06-18 13:43:33 UTC
(
hide
)
Description:
Bug 28581: Use 'from_email_address' where appropriate
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-06-18 13:43:33 UTC
Size:
6.81 KB
patch
obsolete
>From 3189557265177fac392a0697f7e5e8813bbe5b52 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 17 Jun 2021 14:30:59 +0100 >Subject: [PATCH] Bug 28581: Use 'from_email_address' where appropriate > >This patch replaces a few more trivial cases where we were using >library->branchemail with a fallback to KohaAdminEmail to just use the >new library->from_email_address method directly instead. > >There were also a couple of cases where we were passing borrowernumber >and the patrons library from address too.. this is unneccesary as the >code in _send_email_massage will already default to patron library from >address if we do not pass an override. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Added a semicolon. > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Reserves.pm | 2 +- > Koha/Illrequest.pm | 4 ++-- > circ/pendingreserves.pl | 4 ++-- > misc/cronjobs/notice_unprocessed_suggestions.pl | 6 +----- > misc/cronjobs/overdue_notices.pl | 3 +-- > suggestion/suggestion.pl | 6 +----- > 6 files changed, 8 insertions(+), 17 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 0bf8bf6b77..8fb05c1e37 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1849,7 +1849,7 @@ sub _koha_notify_reserve { > > my $library = Koha::Libraries->find( $hold->branchcode )->unblessed; > >- my $admin_email_address = $library->{branchemail} || C4::Context->preference('KohaAdminEmailAddress'); >+ my $admin_email_address = $library->from_email_address; > > my %letter_params = ( > module => 'reserves', >diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm >index 74d9b84d10..01d421f63d 100644 >--- a/Koha/Illrequest.pm >+++ b/Koha/Illrequest.pm >@@ -1335,7 +1335,7 @@ sub generic_confirm { > "No target email addresses found. Either select at least one partner or check your ILL partner library records.") > if ( !$to ); > # Create the from, replyto and sender headers >- my $from = $branch->branchemail; >+ my $from = $branch->from_email_address; > my $replyto = $branch->inbound_ill_address; > Koha::Exceptions::Ill::NoLibraryEmail->throw( > "Your library has no usable email address. Please set it.") >@@ -1427,7 +1427,7 @@ sub send_patron_notice { > # Notice should come from the library where the request was placed, > # not the patrons home library > my $branch = Koha::Libraries->find($self->branchcode); >- my $from_address = $branch->branchemail; >+ my $from_address = $branch->from_email_address; > my $reply_address = $branch->inbound_ill_address; > > # Send the notice to the patron via the chosen transport methods >diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl >index 995d63bd9c..44d4f87e4d 100755 >--- a/circ/pendingreserves.pl >+++ b/circ/pendingreserves.pl >@@ -86,13 +86,13 @@ if ( $op eq 'cancel_reserve' and $reserve_id ) { > }, > ); > if ( $letter ) { >- my $admin_email_address = $library->branchemail || C4::Context->preference('KohaAdminEmailAddress'); >+ my $from_address = $library->from_email_address; > > C4::Letters::EnqueueLetter( > { letter => $letter, > borrowernumber => $patron->borrowernumber, > message_transport_type => 'email', >- from_address => $admin_email_address, >+ from_address => $from_address, > } > ); > unless ( $patron->notice_email_address ) { >diff --git a/misc/cronjobs/notice_unprocessed_suggestions.pl b/misc/cronjobs/notice_unprocessed_suggestions.pl >index 055315c9dd..d2870b2372 100755 >--- a/misc/cronjobs/notice_unprocessed_suggestions.pl >+++ b/misc/cronjobs/notice_unprocessed_suggestions.pl >@@ -48,9 +48,6 @@ for my $number_of_days (@days) { > my $budget = C4::Budgets::GetBudget( $suggestion->{budgetid} ); > my $patron = Koha::Patrons->find( $budget->{budget_owner_id} ); > my $email_address = $patron->notice_email_address; >- my $library = $patron->library; >- my $admin_email_address = $library->branchemail >- || C4::Context->preference('KohaAdminEmailAddress'); > > if ($email_address) { > say "Patron " . $patron->borrowernumber . " is going to be notified" if $verbose; >@@ -70,8 +67,7 @@ for my $number_of_days (@days) { > { > letter => $letter, > borrowernumber => $patron->borrowernumber, >- message_transport_type => 'email', >- from_address => $admin_email_address, >+ message_transport_type => 'email' > } > ); > } >diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl >index 16d708c0dc..6153f54a4f 100755 >--- a/misc/cronjobs/overdue_notices.pl >+++ b/misc/cronjobs/overdue_notices.pl >@@ -469,8 +469,7 @@ foreach my $branchcode (@branches) { > } > > my $library = Koha::Libraries->find($branchcode); >- my $admin_email_address = $library->branchemail >- || C4::Context->preference('KohaAdminEmailAddress'); >+ my $admin_email_address = $library->from_email_address; > my $branch_email_address = C4::Context->preference('AddressForFailedOverdueNotices') > || $library->inbound_email_address; > my @output_chunks; # may be sent to mail or stdout or csv file. >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index 64b4106b2d..5fa769b769 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -188,9 +188,6 @@ if ( $op =~ /save/i ) { > my $patron = Koha::Patrons->find( $suggestion_only->{managedby} ); > my $email_address = $patron->notice_email_address; > if ($patron->notice_email_address) { >- my $library = $patron->library; >- my $admin_email_address = $library->branchemail >- || C4::Context->preference('KohaAdminEmailAddress'); > > my $letter = C4::Letters::GetPreparedLetter( > module => 'suggestions', >@@ -207,8 +204,7 @@ if ( $op =~ /save/i ) { > { > letter => $letter, > borrowernumber => $patron->borrowernumber, >- message_transport_type => 'email', >- from_address => $admin_email_address, >+ message_transport_type => 'email' > } > ); > } >-- >2.20.1
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 28581
:
122056
|
122057
|
122061
|
122062
|
122063
|
122067
|
122068
|
122071
|
122072
|
122073
|
122074
|
122075
|
122076
|
122078
|
122080
|
122081
|
122136
|
122137
|
122138
| 122139 |
122140
|
122212