Bug 28581: (QA follow-up) Prevent code failure
This patch prevents a fatal error when both $params->{from} and $params->{borrowernumber} are undefined. We fallback to KohaAdminEmailAddress before finally falling through to setting a failure status for the message if that last fallback is not found. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
17ac49efaf
commit
f0e2fc04f3
1 changed files with 5 additions and 2 deletions
|
@ -1365,12 +1365,15 @@ sub _send_message_by_email {
|
|||
|
||||
if ($patron) {
|
||||
$library = $patron->library;
|
||||
$branch_email = $library->branchemail;
|
||||
$branch_email = $library->from_email_address;
|
||||
$branch_replyto = $library->branchreplyto;
|
||||
$branch_returnpath = $library->branchreturnpath;
|
||||
}
|
||||
|
||||
my $from_address = $message->{'from_address'} || $library->from_email_address;
|
||||
my $from_address =
|
||||
$message->{'from_address'}
|
||||
|| $branch_email
|
||||
|| C4::Context->preference('KohaAdminEmailAddress');
|
||||
if( !$from_address ) {
|
||||
_set_message_status({
|
||||
message_id => $message->{'message_id'},
|
||||
|
|
Loading…
Reference in a new issue