Bugzilla – Attachment 173729 Details for
Bug 37872
ILL module has issues when plugins are disabled (enable_plugins = 0)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37872: Consider enable_plugins = 0 when fetching plugin backends
Bug-37872-Consider-enableplugins--0-when-fetching-.patch (text/plain), 2.79 KB, created by
David Nind
on 2024-10-30 16:59:40 UTC
(
hide
)
Description:
Bug 37872: Consider enable_plugins = 0 when fetching plugin backends
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-10-30 16:59:40 UTC
Size:
2.79 KB
patch
obsolete
>From dd81f31e435e5fed5d6efbea792cda87197dac1c Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Tue, 29 Oct 2024 11:12:04 +0000 >Subject: [PATCH] Bug 37872: Consider enable_plugins = 0 when fetching plugin > backends > >This patch builds on top of Andreas patch checking for Koha::Plugins->new() instead as the enable_plugins is already done there. >It also adds a check in reply to Joubu's observation, which is indeed an additional bug. > >Test plan: >1) Apply tests patch. Run the tests. Notice it fails >2) Apply the remaining patches. Run the tests. Notice they pass. > >Additional (and better) tests can be written, but for now I think this is good enough. >Additional tests should be written on top of bug 36197 (which adds a dummy ILL backend plugin for testing), at: >https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=36197&attachment=171371 > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/ILL/Request.pm | 9 ++++++--- > Koha/ILL/Request/Config.pm | 10 ++++++---- > 2 files changed, 12 insertions(+), 7 deletions(-) > >diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm >index e7347e5ee3..cc86e75c0e 100644 >--- a/Koha/ILL/Request.pm >+++ b/Koha/ILL/Request.pm >@@ -401,20 +401,23 @@ sub status { > > my $backend_plugin = $self->get_backend_plugin($backend_name); > >-Returns the installed I<Koha::Plugin> corresponding to the given backend_id >+Returns the installed I<Koha::Plugin> corresponding to the given backend_id or undef if no plugin is found > > =cut > > sub get_backend_plugin { > my ( $self, $backend_id ) = @_; > >- my @backend_plugins = Koha::Plugins->new()->GetPlugins( >+ my $koha_plugins = Koha::Plugins->new(); >+ my @backend_plugins = $koha_plugins >+ ? Koha::Plugins->new()->GetPlugins( > { > method => 'ill_backend', > metadata => { name => $backend_id }, > all => 1, > } >- ); >+ ) >+ : (); > > return $backend_plugins[0]; > } >diff --git a/Koha/ILL/Request/Config.pm b/Koha/ILL/Request/Config.pm >index 70f73f0ff5..815f63309f 100644 >--- a/Koha/ILL/Request/Config.pm >+++ b/Koha/ILL/Request/Config.pm >@@ -113,15 +113,17 @@ Returns a list of names for all the installed ILL backend plugins. > =cut > > sub get_backend_plugin_names { >- my ( $self ) = @_; >+ my ($self) = @_; > >- return () unless C4::Context->config("enable_plugins"); >- my @backend_plugins = Koha::Plugins->new()->GetPlugins( >+ my $koha_plugins = Koha::Plugins->new(); >+ my @backend_plugins = $koha_plugins >+ ? $koha_plugins->GetPlugins( > { > method => 'ill_backend', > all => 1 > } >- ); >+ ) >+ : (); > > return map { $_->{metadata}->{name} } @backend_plugins; > } >-- >2.39.5
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 37872
:
171227
|
171237
|
173617
|
173618
|
173619
|
173727
|
173728
|
173729
|
173771
|
173772
|
173773