Bugzilla – Attachment 83517 Details for
Bug 21241
Set suggestion notices message_transport_type to sms if syspref is enabled and patron has an smsalertnumber but no email address
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21241: (follow-up) Made SQL change idempotent
Bug-21241-follow-up-Made-SQL-change-idempotent.patch (text/plain), 3.26 KB, created by
Alex Buckley
on 2018-12-27 01:39:26 UTC
(
hide
)
Description:
Bug 21241: (follow-up) Made SQL change idempotent
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2018-12-27 01:39:26 UTC
Size:
3.26 KB
patch
obsolete
>From 7b8b0e5ee2576ceb07150903d101ecb026a163f7 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Mon, 24 Dec 2018 21:38:24 +0000 >Subject: [PATCH] Bug 21241: (follow-up) Made SQL change idempotent > >Also added the new pref to sysprefs.sql > >Also simplified the conditional statement. > >Sponsored-By: Brimbank Library, Australia >--- > C4/Suggestions.pm | 5 +---- > ...41-add_syspref_to_control_fallback_to_sms_if_no_email_defined.sql | 2 +- > installer/data/mysql/sysprefs.sql | 1 + > 3 files changed, 3 insertions(+), 5 deletions(-) > >diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm >index b418f06..e2dd3e7 100644 >--- a/C4/Suggestions.pm >+++ b/C4/Suggestions.pm >@@ -504,10 +504,7 @@ sub ModSuggestion { > my $full_suggestion = GetSuggestion( $suggestion->{suggestionid} ); > my $patron = Koha::Patrons->find( $full_suggestion->{suggestedby} ); > >- my $transport = 'email'; >- if (C4::Context->preference("FallbackToSMSIfNoEmail")) { >- $transport = ($patron->smsalertnumber) && (!$patron->email) ? 'sms' : 'email'; >- } >+ my $transport = (C4::Context->preference("FallbackToSMSIfNoEmail")) && ($patron->smsalertnumber) && (!$patron->email) ? 'sms' : 'email'; > > if ( > my $letter = C4::Letters::GetPreparedLetter( >diff --git a/installer/data/mysql/atomicupdate/bug_21241-add_syspref_to_control_fallback_to_sms_if_no_email_defined.sql b/installer/data/mysql/atomicupdate/bug_21241-add_syspref_to_control_fallback_to_sms_if_no_email_defined.sql >index 6528f3d..1a9443e 100644 >--- a/installer/data/mysql/atomicupdate/bug_21241-add_syspref_to_control_fallback_to_sms_if_no_email_defined.sql >+++ b/installer/data/mysql/atomicupdate/bug_21241-add_syspref_to_control_fallback_to_sms_if_no_email_defined.sql >@@ -1 +1 @@ >-INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('FallbackToSMSIfNoEmail', 0, 'Enable|Disable', 'Send messages by SMS if no patron email is defined', 'YesNo'); >+INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('FallbackToSMSIfNoEmail', 0, 'Enable|Disable', 'Send messages by SMS if no patron email is defined', 'YesNo'); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 1e36c30..bacfc79 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -173,6 +173,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('FacetLabelTruncationLength','20',NULL,'Specify the facet max length in OPAC','Integer'), > ('FacetMaxCount','20',NULL,'Specify the max facet count for each category','Integer'), > ('FailedLoginAttempts','','','Number of login attempts before lockout the patron account','Integer'), >+('FallbackToSMSIfNoEmail', 0, 'Enable|Disable', 'Send messages by SMS if no patron email is defined', 'YesNo'), > ('FeeOnChangePatronCategory','1','','If set, when a patron changes to a category with enrolment fee, a fee is charged','YesNo'), > ('FilterBeforeOverdueReport','0','','Do not run overdue report until filter selected','YesNo'), > ('FineNotifyAtCheckin','0',NULL,'If ON notify librarians of overdue fines on the items they are checking in.','YesNo'), >-- >2.1.4
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 21241
:
77960
|
79189
|
81625
|
81975
|
82014
|
82018
|
82019
|
82020
| 83517