Bugzilla – Attachment 181853 Details for
Bug 39772
Background jobs page lists unknown job types for jobs implemented by plugins
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39772: Display package names for plugin jobs rather than "unknown" messages
Bug-39772-Display-package-names-for-plugin-jobs-ra.patch (text/plain), 2.70 KB, created by
David Nind
on 2025-05-02 11:53:04 UTC
(
hide
)
Description:
Bug 39772: Display package names for plugin jobs rather than "unknown" messages
Filename:
MIME Type:
Creator:
David Nind
Created:
2025-05-02 11:53:04 UTC
Size:
2.70 KB
patch
obsolete
>From 4d883fa6f5ccb8ed3d46bdff1801e69ba6f6550b Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Tadeusz=20=E2=80=9Etadzik=E2=80=9D=20So=C5=9Bnierz?= > <tadeusz@sosnierz.com> >Date: Tue, 29 Apr 2025 14:20:39 +0200 >Subject: [PATCH] Bug 39772: Display package names for plugin jobs rather than > "unknown" messages > >This slightly improves the current situation, where on background_jobs.pl >each plugin job would be displayed as "Unknown job type 'plugin_...'". >After this patch, we display the implementing package name >(sourced from plugins' background_tasks()), which is slightly more >human-friendly and significantly less error-looking. > >Test plan: > >1. In KTD, install a plugin implementing background jobs (e.g. the KitchenSink) >2. On http://localhost:8081/cgi-bin/koha/plugins/plugins-home.pl, > enable the plugin and run a tool/report from it >3. Observe ugly job types column on http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl >4. Apply the patch >5. Observe the improved job types on http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl > >Signed-off-by: David Nind <david@davidnind.com> >--- > admin/background_jobs.pl | 17 +++++++++++++++++ > .../prog/en/modules/admin/background_jobs.tt | 6 ++++++ > 2 files changed, 23 insertions(+) > >diff --git a/admin/background_jobs.pl b/admin/background_jobs.pl >index dd4f56963a..d51877545b 100755 >--- a/admin/background_jobs.pl >+++ b/admin/background_jobs.pl >@@ -79,4 +79,21 @@ $template->param( > op => $op, > ); > >+my @plugins = Koha::Plugins::GetPlugins( >+ { >+ method => 'background_tasks', >+ } >+); >+my @plugin_job_types; >+for my $plugin (@plugins) { >+ my $tasks = $plugin->background_tasks; >+ for my $id ( keys %$tasks ) { >+ push @plugin_job_types, { >+ id => 'plugin_' . $plugin->get_metadata->{namespace} . "_$id", >+ str => $tasks->{$id}, >+ }; >+ } >+} >+$template->param( plugin_job_types => \@plugin_job_types ); >+ > output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt >index 0c2490f012..c9ba94cd17 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt >@@ -227,6 +227,12 @@ > '_id': 'import_from_kbart_file', > '_str': _("Import titles from a KBART file") > }, >+ [% FOR job_type IN plugin_job_types %] >+ { >+ '_id': '[% job_type.id %]', >+ '_str': '[% job_type.str %]' >+ }, >+ [% END %] > ]; > > function get_job_type (job_type) { >-- >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 39772
:
181648
|
181712
|
181853
|
181854
|
181866
|
181867