Bugzilla – Attachment 148055 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 EmailFieldPrecidence in first_valid_email_address
Bug-29046-Use-EmailFieldPrecidence-in-firstvalidem.patch (text/plain), 1.06 KB, created by
Martin Renvoize (ashimema)
on 2023-03-10 10:49:01 UTC
(
hide
)
Description:
Bug 29046: Use EmailFieldPrecidence in first_valid_email_address
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-03-10 10:49:01 UTC
Size:
1.06 KB
patch
obsolete
>From f6ed69c4e34becb2c040d7171ad7926d09989929 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 EmailFieldPrecidence in > first_valid_email_address > >This patch update the Koha::Patron->first_valid_email_address method to >use the newly defined EmailFieldPrecidence preference. >--- > Koha/Patron.pm | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 9282b38307..41a20ba57d 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -1422,7 +1422,15 @@ 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('EmailFieldPrecidence'); >+ for my $field ( @fields ) { >+ $email = $self->$field; >+ last if ($email ne q{}); >+ } >+ >+ return $email; > } > > =head3 get_club_enrollments >-- >2.39.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