Bug 28221 - process_message_queue.pl missing `use Try::Tiny`
Summary: process_message_queue.pl missing `use Try::Tiny`
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Kyle M Hall (khall)
QA Contact: Testopia
URL:
Keywords:
Depends on: 24183
Blocks:
  Show dependency treegraph
 
Reported: 2021-04-26 10:35 UTC by Kyle M Hall (khall)
Modified: 2021-12-13 21:10 UTC (History)
6 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:
21.05.00,20.11.06,20.05.12
Circulation function:


Attachments
Bug 28221 - Script process_message_queue.pl uses Try::Tiny but doesn't 'use' it (1.28 KB, patch)
2021-04-26 10:37 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 28221: Script process_message_queue.pl uses Try::Tiny but doesn't 'use' it (1.33 KB, patch)
2021-04-26 14:05 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) 2021-04-26 10:35:37 UTC
The message queue processor has a try/catch block, but does not have a 'use Try::Tiny' line. Because of this the following error ocurrs if an instance has any plugins installed that use the before_send_messages hook:

Can't locate object method "catch" via package "1" (perhaps you forgot to load "1"?) at /usr/share/koha/bin/cronjobs/process_message_queue.pl line 86.
Comment 1 Kyle M Hall (khall) 2021-04-26 10:37:32 UTC
Created attachment 120169 [details] [review]
Bug 28221 - Script process_message_queue.pl uses Try::Tiny but doesn't 'use' it

The message queue processor has a try/catch block, but does not have a 'use Try::Tiny' line. Because of this the following error ocurrs if an instance has any plugins installed that use the before_send_messages hook:

Can't locate object method "catch" via package "1" (perhaps you forgot to load "1"?) at /usr/share/koha/bin/cronjobs/process_message_queue.pl line 86.

Test Plan:
1) Install a plugin that uses the before_send_messages hook
2) Run the message queue processor
3) Note the error message
4) Apply this patch
5) Run the message queue processor again
6) No error!
Comment 2 Martin Renvoize (ashimema) 2021-04-26 14:05:15 UTC
Created attachment 120174 [details] [review]
Bug 28221: Script process_message_queue.pl uses Try::Tiny but doesn't 'use' it

The message queue processor has a try/catch block, but does not have a 'use Try::Tiny' line. Because of this the following error ocurrs if an instance has any plugins installed that use the before_send_messages hook:

Can't locate object method "catch" via package "1" (perhaps you forgot to load "1"?) at /usr/share/koha/bin/cronjobs/process_message_queue.pl line 86.

Test Plan:
1) Install a plugin that uses the before_send_messages hook
2) Run the message queue processor
3) Note the error message
4) Apply this patch
5) Run the message queue processor again
6) No error!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize (ashimema) 2021-04-26 14:31:19 UTC
Trivial fix.. oops.

Passing QA
Comment 4 Jonathan Druart 2021-04-27 14:26:17 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 5 Fridolin Somers 2021-04-30 08:40:12 UTC
Pushed to 20.11.x for 20.11.06
Comment 6 David Cook 2021-05-04 03:46:24 UTC
Suggestion for a title change would be "proces_mesage_queue.pl missing Try::Tiny use statement" or "proces_mesage_queue.pl not loading Try::Tiny".

Not a big deal but might just be clearer for release notes.
Comment 7 Andrew Fuerste-Henry 2021-05-24 18:34:38 UTC
Pushed to 20.05.x for 20.05.12
Comment 8 Victor Grousset/tuxayo 2021-05-24 18:49:53 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.