Bug 35148 - before_send_messages plugin hook does not pass the --where option
Summary: before_send_messages plugin hook does not pass the --where option
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Plugin architecture (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Kyle M Hall (khall)
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on: 28474
Blocks:
  Show dependency treegraph
 
Reported: 2023-10-25 13:34 UTC by Kyle M Hall (khall)
Modified: 2024-07-04 20:40 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.05,22.11.12
Circulation function:


Attachments
Bug 35148: before_send_messages plugin hook does not pass the --where option (1.58 KB, patch)
2023-10-25 13:43 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 35148: before_send_messages plugin hook does not pass the --where option (1.64 KB, patch)
2023-10-25 13:55 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) 2023-10-25 13:34:23 UTC
The before_send_messages plugin hook currently sends all the non-smtp related options with the exception of the --where option. This should be added.
Comment 1 Kyle M Hall (khall) 2023-10-25 13:43:41 UTC
Created attachment 157801 [details] [review]
Bug 35148: before_send_messages plugin hook does not pass the --where option

The before_send_messages plugin hook currently sends all the non-smtp related options with the exception of the --where option. This should be added.

Test Plan:
1) Install the latest version of the kitchen sink plugin (
   https://github.com/bywatersolutions/dev-koha-plugin-kitchen-sink/releases
   )
2) Apply this patch
3) Run process_message_queue.pl with a --where option
4) Run the command: ./misc/cronjobs/process_message_queue.pl --where "letter_code='test'"
5) Note the output looks like:
Plugin hook before_send_message called with the params: $VAR1 = {
          'verbose' => 0,
          'where' => 'letter_code=\'test\'',
          'letter_code' => [],
          'type' => [],
          'limit' => undef
        };
Comment 2 Martin Renvoize (ashimema) 2023-10-25 13:55:58 UTC
Created attachment 157802 [details] [review]
Bug 35148: before_send_messages plugin hook does not pass the --where option

The before_send_messages plugin hook currently sends all the non-smtp related options with the exception of the --where option. This should be added.

Test Plan:
1) Install the latest version of the kitchen sink plugin (
   https://github.com/bywatersolutions/dev-koha-plugin-kitchen-sink/releases
   )
2) Apply this patch
3) Run process_message_queue.pl with a --where option
4) Run the command: ./misc/cronjobs/process_message_queue.pl --where "letter_code='test'"
5) Note the output looks like:
Plugin hook before_send_message called with the params: $VAR1 = {
          'verbose' => 0,
          'where' => 'letter_code=\'test\'',
          'letter_code' => [],
          'type' => [],
          'limit' => undef
        };

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize (ashimema) 2023-10-25 13:57:05 UTC
This is a tiny chance and makes perfect sense.. Must admit, I expected to see the hook within C4::Letters::SendQueuedMessages as opposed to in the cron script... but that's nothing to do with this patch.

Going straight for a PQA :)
Comment 4 Tomás Cohen Arazi (tcohen) 2023-10-25 14:10:11 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 5 Fridolin Somers 2023-10-26 08:26:37 UTC
Pushed to 23.05.x for 23.05.05
Comment 6 Matt Blenkinsop 2023-11-13 15:11:42 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x