Bugzilla – Attachment 194514 Details for
Bug 41991
Suspend a plugin method or specific plugin class (per process or vhost)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41991: Introduce SUSPEND_PLUGIN in Koha::Plugins->call
Bug-41991-Introduce-SUSPENDPLUGIN-in-KohaPlugins-c.patch (text/plain), 1.31 KB, created by
Marcel de Rooy
on 2026-03-05 15:03:22 UTC
(
hide
)
Description:
Bug 41991: Introduce SUSPEND_PLUGIN in Koha::Plugins->call
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2026-03-05 15:03:22 UTC
Size:
1.31 KB
patch
obsolete
>From f910ea3bab9fcbc972f55bdbeba84267282bcc4f Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 5 Mar 2026 10:49:48 +0100 >Subject: [PATCH] Bug 41991: Introduce SUSPEND_PLUGIN in Koha::Plugins->call >Content-Type: text/plain; charset=utf-8 > >Test plan: >Add a SetEnv for your staff client in Apache to suspend a plugin class. >Verify that that specific plugin class was not run. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/Plugins.pm | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/Koha/Plugins.pm b/Koha/Plugins.pm >index 4d0cc82876..6ab13df1ff 100644 >--- a/Koha/Plugins.pm >+++ b/Koha/Plugins.pm >@@ -91,6 +91,7 @@ sub call { > my ( $class, $method, @args ) = @_; > > return unless C4::Context->config('enable_plugins'); >+ return if $method && $ENV{"SUSPEND_PLUGIN_$method"}; > > my @responses; > my @plugins = $class->get_enabled_plugins( { verbose => 0 } ); >@@ -102,6 +103,8 @@ sub call { > if $method eq 'after_hold_create' and @plugins; > > foreach my $plugin (@plugins) { >+ ( my $class = ref($plugin) ) =~ s/::/_/g; >+ next if $class && $ENV{"SUSPEND_PLUGIN_$class"}; > my $response = eval { $plugin->$method(@args) }; > if ($@) { > warn sprintf( "Plugin error (%s): %s", $plugin->get_metadata->{name}, $@ ); >-- >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 41991
: 194514 |
194515
|
194516