Bugzilla – Attachment 171448 Details for
Bug 37757
notice_email_address explodes if EmailFieldPrimary is not valid
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37757: Update EmailFieldPrimary value
Bug-37757-Update-EmailFieldPrimary-value.patch (text/plain), 4.08 KB, created by
Martin Renvoize (ashimema)
on 2024-09-13 11:53:39 UTC
(
hide
)
Description:
Bug 37757: Update EmailFieldPrimary value
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-09-13 11:53:39 UTC
Size:
4.08 KB
patch
obsolete
>From 0cbb448b18fb45f8ff0e3b26b7e3652c119dc732 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 28 Aug 2024 14:57:18 -0300 >Subject: [PATCH] Bug 37757: Update EmailFieldPrimary value > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../data/mysql/atomicupdate/bug_37757.pl | 20 +++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 2 +- > .../en/modules/admin/preferences/patrons.pref | 4 ++-- > 3 files changed, 23 insertions(+), 3 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_37757.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_37757.pl b/installer/data/mysql/atomicupdate/bug_37757.pl >new file mode 100755 >index 00000000000..28f75a2fe5d >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_37757.pl >@@ -0,0 +1,20 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_failure say_success say_info); >+ >+return { >+ bug_number => "37757", >+ description => "More robust handling of EmailFieldPrimary syspref values", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ $dbh->do( >+ q{ >+ UPDATE systempreferences >+ SET value=IF(value='OFF','',value), >+ options='|email|emailpro|B_email|cardnumber|MULTI' >+ WHERE variable='EmailFieldPrimary'; >+ } >+ ) == 1 && say_success( $out, "Updated system preference 'EmailFieldPrimary'" ); >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index a865f86cb2a..4f1ac359e1f 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -234,7 +234,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('EmailAddressForPatronRegistrations', '', '', ' If you choose EmailAddressForPatronRegistrations you have to enter a valid email address: ', 'free'), > ('EmailAddressForSuggestions','','',' If you choose EmailAddressForSuggestions you have to enter a valid email address: ','free'), > ('EmailFieldPrecedence','email|emailpro|B_email','','Ordered list of patron email fields to use when AutoEmailPrimaryAddress is set to first valid','multiple'), >-('EmailFieldPrimary','OFF','email|emailpro|B_email|cardnumber|OFF|MULTI','Defines the default email address field where patron email notices are sent.','Choice'), >+('EmailFieldPrimary','','|email|emailpro|B_email|cardnumber|MULTI','Defines the default email address field where patron email notices are sent.','Choice'), > ('EmailFieldSelection','','email|emailpro|B_email','Selection list of patron email fields to use whern AutoEmailPrimaryAddress is set to selected addresses','multiple'), > ('emailLibrarianWhenHoldIsPlaced','0',NULL,'If ON, emails the librarian whenever a hold is placed','YesNo'), > ('EmailOverduesNoEmail','1',NULL,'Send send overdues of patrons without email address to staff','YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >index 3db000432f9..4376132e57e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >@@ -193,13 +193,13 @@ Patrons: > - > - "Use the patron's" > - pref: EmailFieldPrimary >- default: "OFF" >+ default: "" > choices: > email: primary email > emailpro: secondary email > B_email: alternate email > cardnumber: card number >- "OFF": first valid email address >+ "": first valid email address > "MULTI": selected addresses > - 'for sending out email notices.' > - '<br><strong>NOTE:</strong> If set to "first valid", the order in which the email addresses are checked is set in <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EmailFieldPrecedence">EmailFieldPrecedence</a>.' >-- >2.46.0
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 37757
:
170840
|
170841
|
170842
|
170843
|
171160
|
171161
|
171162
|
171163
|
171447
| 171448 |
171449
|
171450
|
171496