Bugzilla – Attachment 181638 Details for
Bug 39765
Old-fashioned ILL backends (not plugins) are not working
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39765: Centralize loaded plugin caching
Bug-39765-Centralize-loaded-plugin-caching.patch (text/plain), 2.25 KB, created by
Pedro Amorim
on 2025-04-29 08:40:51 UTC
(
hide
)
Description:
Bug 39765: Centralize loaded plugin caching
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-04-29 08:40:51 UTC
Size:
2.25 KB
patch
obsolete
>From eccfedf0986db953628eeb323112f67a90ce02c8 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 28 Apr 2025 14:41:18 -0300 >Subject: [PATCH] Bug 39765: Centralize loaded plugin caching > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk> >--- > Koha/ILL/Request.pm | 33 +++++++++++++++++---------------- > 1 file changed, 17 insertions(+), 16 deletions(-) > >diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm >index 87afa890fa5..9b151e3924c 100644 >--- a/Koha/ILL/Request.pm >+++ b/Koha/ILL/Request.pm >@@ -449,18 +449,23 @@ Returns the installed I<Koha::Plugin> corresponding to the given backend_id or u > sub get_backend_plugin { > my ( $self, $backend_id ) = @_; > >- my $koha_plugins = Koha::Plugins->new(); >- my @backend_plugins = $koha_plugins >- ? Koha::Plugins->new()->GetPlugins( >- { >- method => 'ill_backend', >- metadata => { name => $backend_id }, >- all => 1, >- } >- ) >- : (); >+ if ( !$self->{_plugin} ) { >+ my $koha_plugins = Koha::Plugins->new(); >+ my @backend_plugins = $koha_plugins >+ ? Koha::Plugins->new()->GetPlugins( >+ { >+ method => 'ill_backend', >+ metadata => { name => $backend_id }, >+ all => 1, >+ } >+ ) >+ : (); >+ >+ $self->{_plugin} = $backend_plugins[0] >+ if scalar @backend_plugins; >+ } > >- return $backend_plugins[0]; >+ return $self->{_plugin}; > } > > =head3 load_backend >@@ -497,7 +502,6 @@ sub load_backend { > } elsif ($plugin) { > > $self->{_my_backend} = $plugin->new_ill_backend($backend_params); >- $self->{_plugin} = $plugin; > } elsif ($backend_name) { > > # Fallback to loading through backend_dir config >@@ -1166,10 +1170,7 @@ sub expand_template { > $params->{opac_template} = $template_name; > > } else { >- my $plugin = >- $self->{_plugin} >- ? $self->{_plugin} >- : $self->get_plugin( $self->_backend->name ); >+ my $plugin = $self->get_backend_plugin( $self->_backend->name ); > > # Generate path to file to load > my $backend_dir; >-- >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 39765
:
181623
|
181633
|
181634
|
181635
| 181638