Bugzilla – Attachment 138170 Details for
Bug 31245
Job detail view for batch mod explode if job not started
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[ALTERNATIVE-PATCH] Bug 31245: Do not call report for job detail view if job not started
Bug-31245-Do-not-call-report-for-job-detail-view-i.patch (text/plain), 2.22 KB, created by
Jonathan Druart
on 2022-07-27 08:37:27 UTC
(
hide
)
Description:
[ALTERNATIVE-PATCH] Bug 31245: Do not call report for job detail view if job not started
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-07-27 08:37:27 UTC
Size:
2.22 KB
patch
obsolete
>From 25c8582697fbbc44fceb7f09d3521691b47874bb Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 27 Jul 2022 10:35:08 +0200 >Subject: [PATCH] Bug 31245: Do not call report for job detail view if job not > started > >We should not generate the report if the job hasn't started yet > >Test plan: >Stop the koha-worker processes, modify a new item using the batch mod >tool, then see the detail page of the job > >Without this patch an error is generated: >Can't use an undefined value as an ARRAY reference at /kohadevbox/koha/Koha/BackgroundJob/BatchUpdateItem.pm line 175 >--- > admin/background_jobs.pl | 6 ++++-- > .../intranet-tmpl/prog/en/modules/admin/background_jobs.tt | 4 ++-- > 2 files changed, 6 insertions(+), 4 deletions(-) > >diff --git a/admin/background_jobs.pl b/admin/background_jobs.pl >index 8a27c00a274..a4b7b90c0a8 100755 >--- a/admin/background_jobs.pl >+++ b/admin/background_jobs.pl >@@ -52,8 +52,10 @@ if ( $op eq 'view' ) { > } > else { > $template->param( job => $job, ); >- my $report = $job->additional_report() || {}; >- $template->param( %$report ); >+ if ( $job->status ne 'new' ) { >+ my $report = $job->additional_report() || {}; >+ $template->param( %$report ); >+ } > } > } else { > $op = 'list'; >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 4da24feed35..ab1cd65cbad 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 >@@ -137,10 +137,10 @@ > [% job.ended_on | $KohaDates with_hours = 1 %] > </li> > <li><label for="job_data">Report: </label> >- [% PROCESS 'report' %] >+ [% IF job.status != 'new' %][% PROCESS 'report' %][% END %] > </li> > <li><label for="job_data">Detailed messages: </label> >- [% PROCESS 'detail' %] >+ [% IF job.status != 'new' %][% PROCESS 'detail' %][% END %] > </li> > </ol> > </fieldset> >-- >2.25.1
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 31245
:
138169
|
138170
|
138550
|
138551
|
138968
|
138969