From 6764166b20d75e3527b72101d7b02194dd843938 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Fri, 19 Apr 2024 13:28:02 +0000 Subject: [PATCH] Bug 19605: (QA follow-up): available_backends fix reduce available_backends was only considering dir backends for reduce, it should consider all backends, including plugin backends. This relates to the ILLOpacbackends syspref, where if you add a backend name that happens to be a plugin, it was not disabling it for the OPAC. This change considers all backends for Illopacbackends, regardless of if its a plugin or a directory backend. This was made evident while writing tests for bug 36197. Regression tests for this particular use case, and others, are part of bug 36197. Signed-off-by: Katrin Fischer --- Koha/Illrequest/Config.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Koha/Illrequest/Config.pm b/Koha/Illrequest/Config.pm index e318f34c5d..ff2891700c 100644 --- a/Koha/Illrequest/Config.pm +++ b/Koha/Illrequest/Config.pm @@ -146,11 +146,12 @@ sub available_backends { my @backends = (); @backends = glob "$backend_dir/*" if ($backend_dir); @backends = map { basename($_) } @backends; - @backends = grep { $_ =~ /$reduce/ } @backends if $reduce; + + my @all_backends = ( @backends, @backend_plugins_names ); + @all_backends = grep { $_ =~ /$reduce/ } @all_backends if $reduce; # Return unique list of backend names in the event that the same backend is # installed as a plugin AND as the old way through backend_dir - my @all_backends = ( @backends, @backend_plugins_names ); my @all_uniq_backends = uniq(@all_backends); return \@all_uniq_backends; -- 2.39.5