Bug 36051 - Add option to specify SMS::Send driver parameters in a system preference instead of a file
Summary: Add option to specify SMS::Send driver parameters in a system preference inst...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Kyle M Hall (khall)
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on:
Blocks: 37461
  Show dependency treegraph
 
Reported: 2024-02-08 17:42 UTC by Kyle M Hall (khall)
Modified: 2024-07-24 19:39 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/935
Text to go in the release notes:
Version(s) released in:
24.05.00
Circulation function:


Attachments
Bug 36051: Add option to specify SMS::Send driver parameters in a system preference instead of a file (5.51 KB, patch)
2024-02-08 17:47 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 36051 (QA follow-up): Use yaml_preference (1.26 KB, patch)
2024-02-13 16:03 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 36051: Add option to specify SMS::Send driver parameters in a system preference (5.65 KB, patch)
2024-02-13 16:31 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 36051: (QA follow-up): Use yaml_preference (1.32 KB, patch)
2024-02-13 16:31 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 36051: (QA follow-up) Use IGNORE in INSERT (1.10 KB, patch)
2024-02-13 16:31 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall (khall) 2024-02-08 17:42:51 UTC
If an SMS::Send driver ( such as Twilio ) requires additional parameters, those parameters have to be placed in a yaml file named after the SMS::Send driver, and the path to that file specified in the Koha conf file.

It would be good if we had the option to specify those parameters in a YAML system preference instead. This would be less complicated and avoid requiring an administrator to update that data from the backend.
Comment 1 Kyle M Hall (khall) 2024-02-08 17:47:36 UTC
Created attachment 161945 [details] [review]
Bug 36051: Add option to specify SMS::Send driver parameters in a system preference instead of a file

If an SMS::Send driver ( such as Twilio ) requires additional parameters, those parameters have to be placed in a yaml file named after the SMS::Send driver, and the path to that file specified in the Koha conf file.

It would be good if we had the option to specify those parameters in a YAML system preference instead. This would be less complicated and avoid requiring an administrator to update that data from the backend.

Test Plan:
1) Set up an SMS::Send driver that requires additional options;
   a Twilio account meets these requirements and can be created for
   free. Set this up using the traditional file based system.
2) Verify you can send SMS messages
3) Move the contents of that file into the new system preference SMSSendAdditionalOptions
4) Verify you can still send SMS messages
5) Delete the file
6) Verify yet again you can still send SMS messages!
Comment 2 Martin Renvoize (ashimema) 2024-02-12 17:15:27 UTC
Can we use C4::Context->yaml_preference here Kyle?
Comment 3 Kyle M Hall (khall) 2024-02-13 15:51:04 UTC
(In reply to Martin Renvoize from comment #2)
> Can we use C4::Context->yaml_preference here Kyle?

TIL! Can do!
Comment 4 Kyle M Hall (khall) 2024-02-13 16:03:05 UTC
Created attachment 162115 [details] [review]
Bug 36051 (QA follow-up): Use yaml_preference
Comment 5 Martin Renvoize (ashimema) 2024-02-13 16:31:33 UTC
Created attachment 162116 [details] [review]
Bug 36051: Add option to specify SMS::Send driver parameters in a system preference

If an SMS::Send driver ( such as Twilio ) requires additional parameters, those
parameters have to be placed in a yaml file named after the SMS::Send driver,
and the path to that file specified in the Koha conf file.

It would be good if we had the option to specify those parameters in a YAML
system preference instead. This would be less complicated and avoid requiring
an administrator to update that data from the backend.

Test Plan:
1) Set up an SMS::Send driver that requires additional options;
   a Twilio account meets these requirements and can be created for
   free. Set this up using the traditional file based system.
2) Verify you can send SMS messages
3) Move the contents of that file into the new system preference
   SMSSendAdditionalOptions
4) Verify you can still send SMS messages
5) Delete the file
6) Verify yet again you can still send SMS messages!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize (ashimema) 2024-02-13 16:31:36 UTC
Created attachment 162117 [details] [review]
Bug 36051: (QA follow-up): Use yaml_preference

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize (ashimema) 2024-02-13 16:31:39 UTC
Created attachment 162118 [details] [review]
Bug 36051: (QA follow-up) Use IGNORE in INSERT

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize (ashimema) 2024-02-13 16:32:52 UTC
Simple, useful improvement. All works as expected, is resilient to mistakes and QA scripts are happy.. Going for a straight PQA here.
Comment 9 Katrin Fischer 2024-04-12 09:28:17 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 10 Fridolin Somers 2024-05-23 12:44:16 UTC
Not backported to 23.11.x