Bug 39522: (follow up) Add defensive checking before instantiating plugins object
Previously this could have caused issues if enable_plugins was disabled
in koha-conf as we were not checking enabled status before instantiating
an instance of the plugins object.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 05423a313b)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This commit is contained in:
parent
fe7d8e922a
commit
e4e2fcd64f
|
|
@ -213,8 +213,12 @@ sub _error {
|
|||
sub _load {
|
||||
my ($self) = @_;
|
||||
|
||||
# Try to find the class that can handle this plugin
|
||||
my @plugins = Koha::Plugins->new()->get_valuebuilders_installed();
|
||||
# Try to find the class that can handle this plugin, but only if plugins are enabled
|
||||
my @plugins;
|
||||
if ( C4::Context->config("enable_plugins") ) {
|
||||
my $plugins_obj = Koha::Plugins->new();
|
||||
@plugins = $plugins_obj->get_valuebuilders_installed() if $plugins_obj;
|
||||
}
|
||||
|
||||
foreach my $vb (@plugins) {
|
||||
my $plugin = $vb->{plugin};
|
||||
|
|
|
|||
Loading…
Reference in New Issue