[Bug 35930] New: <enable_plugins> variable in koha-conf breaks non-plugin module
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35930 Bug ID: 35930 Summary: <enable_plugins> variable in koha-conf breaks non-plugin module Change sponsored?: --- Product: Koha Version: 23.11 Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Plugin architecture Assignee: koha-bugs@lists.koha-community.org Reporter: hans.palsson@hkr.se QA Contact: testopia@bugs.koha-community.org When upgrading from 23.05 to 23.11.01 our ILL module (https://github.com/Libriotech/koha-illbackend-libris) stopped working until <enable_plugins> variable in koha-conf.xml was set to 1. Plack-error.log showed message Can't call method "GetPlugins" on an undefined value at /usr/share/koha/intranet/cgi-bin/ill/ill-requests.pl line 534. Since the ILL-module is not a plugin this behaviour is unwanted. -- 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=35930 Andreas Jonsson <andreas.jonsson@kreablo.se> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andreas.jonsson@kreablo.se --- Comment #1 from Andreas Jonsson <andreas.jonsson@kreablo.se> --- This is caused by the changes introduced in bug 30719: # Get available metadata enrichment plugins sub get_metadata_enrichment { my @candidates = Koha::Plugins->new()->GetPlugins({ method => 'provides_api' }); my @services = (); foreach my $plugin(@candidates) { my $supported = $plugin->provides_api(); if ($supported->{type} eq 'search') { push @services, $supported; } } return \@services; } -- 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=35930 --- Comment #2 from Andreas Jonsson <andreas.jonsson@kreablo.se> --- Created attachment 162018 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162018&action=edit Bug 35930: Add guards for plugins_enabled There are ILL-backends that are not implemented as Koha plubins and does not require plugins to be enabled. The 'new' method in Koha::Plugins returns undefined if plugins are disabled. Therefore, calls to this method must be guarded by a check that plugins actually are enabled. Test plan: * Code inspection of patch, alternatively * Activate the ill system by installing a backend such as koha-illbackend-libris: https://github.com/Libriotech/koha-illbackend-libris * Make sure plugins are disabled in koha-conf.xml * In the staff interface, go to ILL requests. * The page should load without getting an error 500. -- 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=35930 Andreas Jonsson <andreas.jonsson@kreablo.se> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |30719 Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30719 [Bug 30719] ILL should provide the ability to create batch requests -- 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=35930 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- 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=35930 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162018|0 |1 is obsolete| | --- Comment #3 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 162019 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162019&action=edit Bug 35930: Add guards for plugins_enabled The 'new' method in Koha::Plugins returns undefined if plugins are disabled. Therefore, calls to this method must be guarded by a check that plugins actually are enabled. Test plan: * Code inspection of patch, alternatively * Activate the ill system by installing a backend such as koha-illbackend-libris: https://github.com/Libriotech/koha-illbackend-libris * Make sure plugins are disabled in koha-conf.xml * In the staff interface, go to ILL requests. * The page should load without getting an error 500. PA amended commit message: This is not related to ILL backends being plugins or not This is about ILL batches, where checking for metadata enrichment plugins was missing 'enable_plugins' guard Additionally, unrelated to batches, it's also about ILLAvailability, where checking for ILL availabililty plugins was missing enable_plugins guard Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.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=35930 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |magnus@libriotech.no, | |martin.renvoize@ptfs-europe | |.com, | |pedro.amorim@ptfs-europe.co | |m, tomascohen@gmail.com --- Comment #4 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Thanks @Andreas. This makes sense, and I've tested to also make sure there are no regressions: ILLCheckAvailability -> enabled, installed an availability plugin and tested with enable_plugins 0 and 1, all working as expected: https://github.com/PTFS-Europe/koha-plugin-ill-avail-eds Installed a metadata enrichment plugin, tested with ILL batches, with enable_plugins 0 and 1, all working as expected: https://github.com/PTFS-Europe/koha-plugin-api-pubmed "As expected" above means these features are not available if enable_plugins=0 and no errors occur. If someone else SOs this, please convert my SO to PQA and update accordingly. -- 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=35930 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major --- Comment #5 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Upping this to "major" as it will cause an ugly 500 error and block ILL basic functionality for installations using ILLModule with enable_plugins=0. -- 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=35930 Hans Pålsson <hans.palsson@hkr.se> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #6 from Hans Pålsson <hans.palsson@hkr.se> --- Tested the patch and it works. I mark this as PQA per request, if that´s wrong I'll take the blame. :) -- 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=35930 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | Version|23.11 |master -- 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=35930 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162019|0 |1 is obsolete| | --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 162038 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162038&action=edit Bug 35930: Add guards for plugins_enabled The 'new' method in Koha::Plugins returns undefined if plugins are disabled. Therefore, calls to this method must be guarded by a check that plugins actually are enabled. Test plan: * Code inspection of patch, alternatively * Activate the ill system by installing a backend such as koha-illbackend-libris: https://github.com/Libriotech/koha-illbackend-libris * Make sure plugins are disabled in koha-conf.xml * In the staff interface, go to ILL requests. * The page should load without getting an error 500. PA amended commit message: This is not related to ILL backends being plugins or not This is about ILL batches, where checking for metadata enrichment plugins was missing 'enable_plugins' guard Additionally, unrelated to batches, it's also about ILLAvailability, where checking for ILL availabililty plugins was missing enable_plugins guard Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- 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=35930 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |andreas.jonsson@kreablo.se |ity.org | -- 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=35930 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|<enable_plugins> variable |ILL batches and |in koha-conf breaks |availability broken if |non-plugin module |plugins disabled -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35930 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Hans Pålsson from comment #6)
Tested the patch and it works. I mark this as PQA per request, if that´s wrong I'll take the blame. :)
It never hurts to have more testers :-D Don't forget to stamp your signature on the patch, though. ``` git commit --amend -s --no-edit ``` Best regards -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35930 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|ILL batches and |ILL module broken if |availability broken if |plugins disabled |plugins disabled | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35930 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.05.00 released in| | --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I added Hans Pålsson signoff line inline and have pushed to master for 24.05.00 to allow rmaints to backport for the next releases. Thanks for your work everyone. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35930 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=35930 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m Version(s)|24.05.00 |24.05.00,23.11.03 released in| | --- Comment #10 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35930 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|martin.renvoize@ptfs-europe | |.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35930 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org