From 8dd81c7bbc1f9d74fab6b9b3e822a08fa15cbfed Mon Sep 17 00:00:00 2001 From: Andreas Jonsson Date: Mon, 9 Sep 2024 16:51:10 +0000 Subject: [PATCH] Bug 37872: Add guards for enable_plugins There are ILL-backends that are not implemented as Koha plugins 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. Testplan for koha-testing-docker: - Edit /etc/koha/sites/kohadev/koha-conf.xml and disable plugins by setting 0 - sudo koha-mysql kohadev -e "UPDATE systempreferences SET value='1' WHERE variable='ILLModule';" - Run restart_all. - In staff interface, go to About koha -> System information. The page should load normally (as opposed to returning 500 internal server error). Signed-off-by: David Nind Signed-off-by: Pedro Amorim --- Koha/ILL/Request/Config.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Koha/ILL/Request/Config.pm b/Koha/ILL/Request/Config.pm index f4e19ff95f..332bc7cbb2 100644 --- a/Koha/ILL/Request/Config.pm +++ b/Koha/ILL/Request/Config.pm @@ -115,6 +115,7 @@ Returns a list of names for all the installed ILL backend plugins. sub get_backend_plugin_names { my ( $self ) = @_; + return () unless C4::Context->config("enable_plugins"); my @backend_plugins = Koha::Plugins->new()->GetPlugins( { method => 'ill_backend', -- 2.39.5