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
Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
}
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';
[% 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>