Bugzilla – Attachment 173773 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.85 KB, created by
Martin Renvoize (ashimema)
on 2024-10-31 11:29:37 UTC
(
hide
)
Description:
Bug 37872: Consider enable_plugins = 0 when fetching plugin backends
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-10-31 11:29:37 UTC
Size:
2.85 KB
patch
obsolete
>From 7bc8a1db0854aaa5823547f89e846312f9ead665 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> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.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 9bc3ebc4d20..8923db9e866 100644 >--- a/Koha/ILL/Request.pm >+++ b/Koha/ILL/Request.pm >@@ -403,20 +403,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 332bc7cbb2a..687c343cc6c 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.47.0
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