Bugzilla – Attachment 192632 Details for
Bug 38384
General fix for plugins breaking database transactions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38384: (follow-up) Move loading into Koha::Plugins BEGIN block
e3fd4a1.patch (text/plain), 2.09 KB, created by
Tomás Cohen Arazi (tcohen)
on 2026-02-06 15:21:58 UTC
(
hide
)
Description:
Bug 38384: (follow-up) Move loading into Koha::Plugins BEGIN block
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2026-02-06 15:21:58 UTC
Size:
2.09 KB
patch
obsolete
>From e3fd4a13e64fa9e2453a38b0074cfebec43ba954 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 22 Jan 2026 13:51:46 +0000 >Subject: [PATCH] Bug 38384: (follow-up) Move loading into Koha::Plugins BEGIN > block >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Thinking about this today, we really just need the plugins initialized anytime we are using Koha::Plugins > >Moving the loading into the BEGIN there seems to resolve the issue > >Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> >--- > C4/Context.pm | 13 ------------- > Koha/Plugins.pm | 9 +++++++++ > 2 files changed, 9 insertions(+), 13 deletions(-) > >diff --git a/C4/Context.pm b/C4/Context.pm >index 2cd62adc3e..6c51b3b862 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -22,19 +22,6 @@ use Modern::Perl; > use vars qw($AUTOLOAD $context); > > BEGIN { >- # Load plugins early to ensure they're available before any transactions begin >- my $enable_plugins = 0; >- if ( exists $ENV{'KOHA_CONF'} && -e $ENV{'KOHA_CONF'} ) { >- require Koha::Config; >- my $config = Koha::Config->get_instance; >- $enable_plugins = $config->get('enable_plugins') // 0; >- } >- >- if ($enable_plugins) { >- require Koha::Plugins::Loader; >- Koha::Plugins::Loader->get_enabled_plugins(); >- } >- > if ( $ENV{'HTTP_USER_AGENT'} ) { # Only hit when plack is not enabled > > # Redefine multi_param if cgi version is < 4.08 >diff --git a/Koha/Plugins.pm b/Koha/Plugins.pm >index 84ca675c5f..4d0cc82876 100644 >--- a/Koha/Plugins.pm >+++ b/Koha/Plugins.pm >@@ -45,6 +45,15 @@ BEGIN { > my @pluginsdir = ref($pluginsdir) eq 'ARRAY' ? @$pluginsdir : $pluginsdir; > push @INC, array_minus( @pluginsdir, @INC ); > pop @INC if $INC[-1] eq '.'; >+ >+ # Load plugins early to ensure they're available before any transactions begin >+ my $enable_plugins = C4::Context->config("enable_plugins") // 0; >+ >+ if ($enable_plugins) { >+ require Koha::Plugins::Loader; >+ Koha::Plugins::Loader->get_enabled_plugins(); >+ } >+ > } > > =head1 NAME >-- >2.50.1 (Apple Git-155) >
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 38384
:
174150
|
174264
|
174265
|
174280
|
174282
|
189636
|
189637
|
189638
|
189639
|
189640
|
190514
|
190515
|
190516
|
190517
|
191860
|
192119
|
192628
|
192629
|
192630
|
192631
|
192632
|
192633
|
192662
|
192663
|
192664
|
192665
|
192666
|
192667
|
193142
|
193143
|
193144
|
193171
|
193172
|
193173
|
193174
|
193175
|
193176
|
193177
|
193178
|
193179