Bugzilla – Attachment 162018 Details for
Bug 35930
ILL module broken if plugins disabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35930: Add guards for plugins_enabled
Bug-35930-Add-guards-for-pluginsenabled.patch (text/plain), 1.90 KB, created by
Andreas Jonsson
on 2024-02-12 11:26:11 UTC
(
hide
)
Description:
Bug 35930: Add guards for plugins_enabled
Filename:
MIME Type:
Creator:
Andreas Jonsson
Created:
2024-02-12 11:26:11 UTC
Size:
1.90 KB
patch
obsolete
>From d5ba1300f14149b37d6cee50762cd1aeb7a95929 Mon Sep 17 00:00:00 2001 >From: Andreas Jonsson <andreas.jonsson@kreablo.se> >Date: Mon, 12 Feb 2024 11:16:02 +0000 >Subject: [PATCH] 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. >--- > Koha/Illrequest/Workflow/Availability.pm | 2 ++ > ill/ill-requests.pl | 1 + > 2 files changed, 3 insertions(+) > >diff --git a/Koha/Illrequest/Workflow/Availability.pm b/Koha/Illrequest/Workflow/Availability.pm >index 4fd75a48a9..bcc50f6fe7 100644 >--- a/Koha/Illrequest/Workflow/Availability.pm >+++ b/Koha/Illrequest/Workflow/Availability.pm >@@ -64,6 +64,8 @@ sub get_services { > $plugin_filter->{metadata} = $params->{metadata}; > } > >+ return [] unless C4::Context->config("enable_plugins"); >+ > my @candidates = Koha::Plugins->new()->GetPlugins($plugin_filter); > my @services = (); > foreach my $plugin (@candidates) { >diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl >index a668b25979..2e87730884 100755 >--- a/ill/ill-requests.pl >+++ b/ill/ill-requests.pl >@@ -531,6 +531,7 @@ sub can_batch { > > # Get available metadata enrichment plugins > sub get_metadata_enrichment { >+ return [] unless C4::Context->config("enable_plugins"); > my @candidates = Koha::Plugins->new()->GetPlugins({ > method => 'provides_api' > }); >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35930
:
162018
|
162019
|
162038