Bugzilla – Attachment 184854 Details for
Bug 40547
Unable to view background job if enable_plugins is 0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40547: Background jobs should appear even when plugins disabled
Bug-40547-Background-jobs-should-appear-even-when-.patch (text/plain), 1.67 KB, created by
David Cook
on 2025-07-30 06:42:40 UTC
(
hide
)
Description:
Bug 40547: Background jobs should appear even when plugins disabled
Filename:
MIME Type:
Creator:
David Cook
Created:
2025-07-30 06:42:40 UTC
Size:
1.67 KB
patch
obsolete
>From 29644d86fb5fa1b8d202c0345f510ca2ac3a5db0 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Wed, 30 Jul 2025 06:41:25 +0000 >Subject: [PATCH] Bug 40547: Background jobs should appear even when plugins > disabled > >This change fixes the background jobs so that the list page loads >even when plugins are disabled. > >Test plan: >0. Apply the patch >1. Download https://github.com/HKS3/koha-normalize-marc2db/releases/download/v0.91/Koha.Plugin.HKS3.NormalizeMARC2DB-0.91.kpz >2. Upload plugin into KTD >3. Click "Run tool" for plugin >4. Go to http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl >5. Note that you see a pretty "Type" >6. Go to /etc/koha/sites/kohadev/koha-conf.xml and turn enable_plugins to 0 >7. sudo koha-plack --restart kohadev >8. Go to http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl >9. Note it now says "Unknown job type 'plugin_marc2db_normalizeall' >10. Celebrate as this is preferable to a 500 error >--- > admin/background_jobs.pl | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > >diff --git a/admin/background_jobs.pl b/admin/background_jobs.pl >index d1ce61e33e..67c3428165 100755 >--- a/admin/background_jobs.pl >+++ b/admin/background_jobs.pl >@@ -79,11 +79,15 @@ $template->param( > op => $op, > ); > >-my @plugins = Koha::Plugins->new()->GetPlugins( >- { >- method => 'background_tasks', >- } >-); >+my @plugins = (); >+my $plugin_manager = Koha::Plugins->new(); >+if ($plugin_manager) { >+ @plugins = $plugin_manager->GetPlugins( >+ { >+ method => 'background_tasks', >+ } >+ ); >+} > my @plugin_job_types; > for my $plugin (@plugins) { > my $tasks = $plugin->background_tasks; >-- >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 40547
:
184854
|
184918
|
184931