[Bug 24031] New: Add plugin hook after_hold_create
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Bug ID: 24031 Summary: Add plugin hook after_hold_create Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: julian.maurice@biblibre.com Reporter: julian.maurice@biblibre.com QA Contact: testopia@bugs.koha-community.org This hook will be called after a hold has been placed. The need behind that is to create a plugin that will send a mail to the patron that has borrowed the reserved item, saying something like "Someone has requested this item, please return it as soon as you can" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 95358 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95358&action=edit Bug 24031: Add plugin hook after_hold_create It is called after a hold has been placed Test plan: 1. Write a plugin that implements only after_hold_create (see `perldoc Koha::Plugins` for implementation details). Install it and enable it 2. Place a hold and verify that your plugin method has been called with the right parameters -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95358|0 |1 is obsolete| | --- Comment #2 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 95657 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95657&action=edit Bug 24031: Add plugin hook after_hold_create It is called after a hold has been placed Test plan: 1. Write a plugin that implements only after_hold_create (see `perldoc Koha::Plugins` for implementation details). Install it and enable it 2. Place a hold and verify that your plugin method has been called with the right parameters Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 95658 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95658&action=edit Bug 24031: Fix warnings Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Please remember to add the new hook to the wiki once pushed: https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 paxed <pasi.kallinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95657|0 |1 is obsolete| | --- Comment #5 from paxed <pasi.kallinen@koha-suomi.fi> --- Created attachment 98788 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98788&action=edit Bug 24031: Add plugin hook after_hold_create It is called after a hold has been placed Test plan: 1. Write a plugin that implements only after_hold_create (see `perldoc Koha::Plugins` for implementation details). Install it and enable it 2. Place a hold and verify that your plugin method has been called with the right parameters Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 paxed <pasi.kallinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95658|0 |1 is obsolete| | --- Comment #6 from paxed <pasi.kallinen@koha-suomi.fi> --- Created attachment 98789 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98789&action=edit Bug 24031: Fix warnings Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- if (C4::Context->preference('UseKohaPlugins') && C4::Context->config('enable_plugins')) { + my @plugins = $class->new({ enable_plugins => 1 })->GetPlugins({ method => $method }); + my @responses; + foreach my $plugin (@plugins) { + my $response = $plugin->$method(@args); + push @responses, $response; + } + + return @responses; + } No error checking? What if one of the plugins fails, should you continue? Should you use eval? Should $method be checked somehow before calling it rightaway? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- No reply to earlier questions. No update for bug 20415. Changing status. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Architecture, internals, |Plugin architecture |and plumbing | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 --- Comment #9 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 105256 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105256&action=edit Bug 24031: Remove check for syspref UseKohaPlugins UseKohaPlugins has been removed by bug 20415 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 --- Comment #10 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 105257 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105257&action=edit Bug 24031: Add safety checks in Koha::Plugins::call - Check that the plugin has the method before calling it - Call the method in an eval block to prevent fatal errors -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98788|0 |1 is obsolete| | Attachment #98789|0 |1 is obsolete| | Attachment #105256|0 |1 is obsolete| | Attachment #105257|0 |1 is obsolete| | --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 105693 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105693&action=edit Bug 24031: Add plugin hook after_hold_create It is called after a hold has been placed Test plan: 1. Write a plugin that implements only after_hold_create (see `perldoc Koha::Plugins` for implementation details). Install it and enable it 2. Place a hold and verify that your plugin method has been called with the right parameters Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105693|0 |1 is obsolete| | --- Comment #12 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 105694 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105694&action=edit Bug 24031: Add plugin hook after_hold_create It is called after a hold has been placed Test plan: 1. Write a plugin that implements only after_hold_create (see `perldoc Koha::Plugins` for implementation details). Install it and enable it 2. Place a hold and verify that your plugin method has been called with the right parameters Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 --- Comment #13 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 105695 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105695&action=edit Bug 24031: Fix warnings Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 --- Comment #14 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 105696 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105696&action=edit Bug 24031: Remove check for syspref UseKohaPlugins UseKohaPlugins has been removed by bug 20415 Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 --- Comment #15 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 105697 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105697&action=edit Bug 24031: Add safety checks in Koha::Plugins::call - Check that the plugin has the method before calling it - Call the method in an eval block to prevent fatal errors Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |25712 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25712 [Bug 25712] Add plugin hooks to transform patron and item barcodes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 --- Comment #16 from Kyle M Hall <kyle@bywatersolutions.com> --- Needs hook listed in Koha::Plugin::Test with corresponding unit tests. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 --- Comment #17 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 107042 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=107042&action=edit Bug 24031: Add hook to test plugin with unit test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 --- Comment #18 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 107365 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=107365&action=edit Bug 24031: (QA follow-up) Add tests for the AddReserve intervention This patch adds tests for AddReserve Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |26063 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26063 [Bug 26063] Use Koha::Plugins->call for circulation hooks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #19 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Julian, can you have a look at bug 26063 and tell us if it's what you had in mind with Koha::Plugins->call please? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 --- Comment #20 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Jonathan Druart from comment #19)
Julian, can you have a look at bug 26063 and tell us if it's what you had in mind with Koha::Plugins->call please?
This is exactly what I had in mind :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 --- Comment #21 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #22 from Lucas Gass <lucas@bywatersolutions.com> --- enhancement not backported to 20.05.x series -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24031 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org