[Bug 41684] New: notices_content hook is not checking if individual plugins are enabled and is reloading plugins
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41684 Bug ID: 41684 Summary: notices_content hook is not checking if individual plugins are enabled and is reloading plugins Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Plugin architecture Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Bug 39870 added a new hook 'notices_content' When searching for plugins, however, this hook does not check whether the plugin is enabled or not Additionally, since not using Koha::Plugins->call or get_enabled_plugins, this is loading the plugin code again and breaking transactions as we have done in other places. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41684 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=38384 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41684 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41684 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41684 --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 191885 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191885&action=edit Bug 41684: Make `notices_content` hook be used with `get_enabled_plugins()` This patch makes the plugin hook load plugins using `get_enabled_plugins()`. This has the immediate effect of using the already cached plugin objects without reinstantiating them. This way transactions don't get broken for schema reloads. Also, only enabled plugins are loaded/attempted to be loaded. To test: 1. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Plugins/Notices_content_hook.t => SUCCESS: Tests pass 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests still pass: fundamental behavior remains unchanged. 4. Sign off :-D Signed-off-by: Tomás 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=41684 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk, | |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41684 Chip Halvorsen <Chip.Halvorsen@WestlakeLibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Chip.Halvorsen@WestlakeLibr | |ary.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41684 David Nind <david@davidnind.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=41684 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #191885|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41684 --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 191892 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191892&action=edit Bug 41684: Make `notices_content` hook be used with `get_enabled_plugins()` This patch makes the plugin hook load plugins using `get_enabled_plugins()`. This has the immediate effect of using the already cached plugin objects without reinstantiating them. This way transactions don't get broken for schema reloads. Also, only enabled plugins are loaded/attempted to be loaded. To test: 1. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Plugins/Notices_content_hook.t => SUCCESS: Tests pass 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests still pass: fundamental behavior remains unchanged. 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41684 --- Comment #3 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- This only worked for me after apply bug 38384 Without that additional set, I still received db locks To test: 1 - Install Rapido plugin 2 - Disable Rapido plugin 3 - Add a notice with code HOLD_CANCELLATION - add title and content to email transport and save 4 - Place several holds for patrons with email addresses 5 - In the DB: UPDATE reserves SET reservedate='2025-01-01' 6 - On command line: perl misc/cronjobs/holds/cancel_unfilled_holds.pl -d 35 -v -c -r unfilled 7 - The first one often succeeed, but then second locks 8 - Apply patch 9 - Clean any partial cancelled holds: DELETE FROM old_reserves; 10 - Repeat 6 11 - Still freezes 12 - Repeat 9 13 - Apply 38384 14 - Repeat 6 15 - Success! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41684 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@openfifth.c |y.org |o.uk Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41684 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #191892|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41684 --- Comment #4 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192338 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192338&action=edit Bug 41684: Make `notices_content` hook be used with `get_enabled_plugins()` This patch makes the plugin hook load plugins using `get_enabled_plugins()`. This has the immediate effect of using the already cached plugin objects without reinstantiating them. This way transactions don't get broken for schema reloads. Also, only enabled plugins are loaded/attempted to be loaded. To test: 1. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Plugins/Notices_content_hook.t => SUCCESS: Tests pass 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests still pass: fundamental behavior remains unchanged. 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41684 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41684 --- Comment #5 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41684 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|26.05.00 |26.05.00,25.11.03 released in| | Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41684 --- Comment #6 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Thanks all, pushed to 25.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org