From 7fe17c5b1f7bb689d012e4d4ccea2a205142e1f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Olangcay=20Brisebois?= Date: Wed, 17 Apr 2019 11:50:48 -0400 Subject: [PATCH] Bug 12532 - (follow-up) clean up --- Koha/Patron.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) mode change 100644 => 100755 Koha/Patron.pm diff --git a/Koha/Patron.pm b/Koha/Patron.pm old mode 100644 new mode 100755 index c491649db5..bbac94da6f --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -1028,6 +1028,7 @@ Returns the empty string if no email address. sub notice_email_address{ my ( $self ) = @_; my $address; + my $guarantor_address; my $which_address = C4::Context->preference("AutoEmailPrimaryAddress"); # if syspref is set to 'first valid' (value == OFF), look up email address @@ -1041,11 +1042,15 @@ sub notice_email_address{ if ($use_guarantor) { my $guarantor = $self->guarantor; if ($guarantor) { - my $guarantor_address = $guarantor->notice_email_address; + if ( $which_address eq 'OFF' ) { + $guarantor_address = $guarantor->first_valid_email_address; + } else { + $guarantor_address = $guarantor->$which_address || ''; + } if ($address){ - $address .= ', '; + $address .= ', '; } - $address .= $guarantor_address if $guarantor_address; + $address .= $guarantor_address if $guarantor_address; } } return $address; -- 2.17.1