Bugzilla – Attachment 194619 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.48 KB, created by
Marcel de Rooy
on 2026-03-06 08:08:35 UTC
(
hide
)
Description:
Bug 41991: Introduce SUSPEND_PLUGIN in Koha::Plugins->call
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2026-03-06 08:08:35 UTC
Size:
1.48 KB
patch
obsolete
>From 47ab54dd4b13fe984bc8e41e240424ee0e0a81cf 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. >Also add a RequestHeader as described in Koha/Middleware/SetEnv. >Example: > SetEnv SUSPEND_PLUGIN_report "1" > RequestHeader add X-Koha-SetEnv "SUSPEND_PLUGIN_report 1" > >Verify that the specific plugin class/method 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
|
194618
| 194619 |
194620