From 7edce653ba39a39e53aec7765bfd921e21ce2776 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Fri, 20 Dec 2024 12:05:20 +0000 Subject: [PATCH] Bug 38761: Don't pass the 'all' param when getting plugins Test plan: 1) Apply tests patch. Run. Notice it fails 2) Apply this patch. Run tests patch. Notice if passes. UI: 1) Enable ILLModule and install a backend plugin e.g.: https://github.com/PTFS-Europe/koha-ill-backend-plugin/releases/tag/v2.0.5 2) Create an ILL request: http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl 3) Notice when you click 'New ILL request', 'PluginBackend' is listed even if the plugin is disabled. This patch fixes that. If there are existing requests and then their respective backend is disabled, no error occurs as plugins are loaded in the background even if disabled Signed-off-by: David Nind Signed-off-by: Martin Renvoize --- Koha/ILL/Request/Config.pm | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Koha/ILL/Request/Config.pm b/Koha/ILL/Request/Config.pm index 687c343cc6c..7000299bfe1 100644 --- a/Koha/ILL/Request/Config.pm +++ b/Koha/ILL/Request/Config.pm @@ -108,21 +108,17 @@ sub backend_dir { my @backend_names = $config->get_backend_plugin_names(); -Returns a list of names for all the installed ILL backend plugins. +Returns a list of names for all the installed (and enabled) ILL backend plugins. =cut sub get_backend_plugin_names { my ($self) = @_; - my $koha_plugins = Koha::Plugins->new(); - my @backend_plugins = $koha_plugins - ? $koha_plugins->GetPlugins( - { - method => 'ill_backend', - all => 1 - } - ) + my $koha_plugins = Koha::Plugins->new(); + my @backend_plugins = + $koha_plugins + ? $koha_plugins->GetPlugins( { method => 'ill_backend' } ) : (); return map { $_->{metadata}->{name} } @backend_plugins; -- 2.47.1