Bugzilla – Attachment 150125 Details for
Bug 29046
Allow libraries to specify email order for "AutoEmailPrimaryAddress"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29046: Use EmailFieldPrecedence in first_valid_email_address
Bug-29046-Use-EmailFieldPrecedence-in-firstvalidem.patch (text/plain), 1.20 KB, created by
Katrin Fischer
on 2023-04-23 11:41:56 UTC
(
hide
)
Description:
Bug 29046: Use EmailFieldPrecedence in first_valid_email_address
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-04-23 11:41:56 UTC
Size:
1.20 KB
patch
obsolete
>From da9d80db658193167935f2d3315dded6b424c6eb Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 10 Mar 2023 10:47:51 +0000 >Subject: [PATCH] Bug 29046: Use EmailFieldPrecedence in > first_valid_email_address > >This patch update the Koha::Patron->first_valid_email_address method to >use the newly defined EmailFieldPrecedence preference. > >Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > Koha/Patron.pm | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index f0e1734217..b8762e9a2f 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -1435,7 +1435,16 @@ Returns the empty string if the borrower has no email addresses. > sub first_valid_email_address { > my ($self) = @_; > >- return $self->email() || $self->emailpro() || $self->B_email() || q{}; >+ my $email = q{}; >+ >+ my @fields = split /\s*\|\s*/, >+ C4::Context->preference('EmailFieldPrecedence'); >+ for my $field (@fields) { >+ $email = $self->$field; >+ last if ( $email ne q{} ); >+ } >+ >+ return $email; > } > > =head3 get_club_enrollments >-- >2.30.2
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 29046
:
148054
|
148055
|
148056
|
148057
|
148145
|
148146
|
148147
|
148155
|
149385
|
149386
|
149387
|
149959
|
149960
|
149961
|
149962
|
149963
|
150124
| 150125 |
150126
|
150127
|
150128
|
150129