Bugzilla – Attachment 189847 Details for
Bug 39522
Add hooks to allow 'Valuebuilder' plugins to be installable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39522: (follow up) Add defensive checking before instantiating plugins object
ab368fb.patch (text/plain), 1.32 KB, created by
Jonathan Druart
on 2025-11-21 14:08:02 UTC
(
hide
)
Description:
Bug 39522: (follow up) Add defensive checking before instantiating plugins object
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-11-21 14:08:02 UTC
Size:
1.32 KB
patch
obsolete
>From ab368fbabfe59838bba5de56b81b638640d7e075 Mon Sep 17 00:00:00 2001 >From: Jacob O'Mara <jacob.omara@openfifth.co.uk> >Date: Thu, 13 Nov 2025 10:12:06 +0000 >Subject: [PATCH] Bug 39522: (follow up) Add defensive checking before > instantiating plugins object > >Previously this could have caused issues if enable_plugins was disabled >in koha-conf as we were not checking enabled status before instantiating >an instance of the plugins object. > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > Koha/FrameworkPlugin.pm | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/Koha/FrameworkPlugin.pm b/Koha/FrameworkPlugin.pm >index 3655a5d3b06..844957bf0d1 100644 >--- a/Koha/FrameworkPlugin.pm >+++ b/Koha/FrameworkPlugin.pm >@@ -213,8 +213,12 @@ sub _error { > sub _load { > my ($self) = @_; > >- # Try to find the class that can handle this plugin >- my @plugins = Koha::Plugins->new()->get_valuebuilders_installed(); >+ # Try to find the class that can handle this plugin, but only if plugins are enabled >+ my @plugins; >+ if ( C4::Context->config("enable_plugins") ) { >+ my $plugins_obj = Koha::Plugins->new(); >+ @plugins = $plugins_obj->get_valuebuilders_installed() if $plugins_obj; >+ } > > foreach my $vb (@plugins) { > my $plugin = $vb->{plugin}; >-- >2.43.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 39522
:
180283
|
180284
|
180301
|
180302
|
180337
|
180338
|
183467
|
183468
|
183469
|
184030
|
184031
|
184032
|
184033
|
184034
|
184071
|
184072
|
189536
|
189537
|
189538
|
189539
|
189540
|
189544
|
189545
|
189546
|
189547
|
189548
|
189549
|
189842
|
189843
|
189844
|
189845
|
189846
| 189847