From ca7cb4896d1dee0f266f12d778a3cb841f05afaf Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 26 Jul 2022 10:12:05 -0300 Subject: [PATCH] Bug 31245: Do not try to report results if task not started Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall Signed-off-by: Andrew Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 12bc623ae7bcbd03fd4c8505bf1c55010bb3d0f7) Signed-off-by: Lucas Gass (cherry picked from commit 3d3fc0f85a5fada38083a99fa8584ccc72c6d5bd) Signed-off-by: Arthur Suzuki --- Koha/BackgroundJob/BatchUpdateItem.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/BackgroundJob/BatchUpdateItem.pm b/Koha/BackgroundJob/BatchUpdateItem.pm index fb50893991..fa5d6c625d 100644 --- a/Koha/BackgroundJob/BatchUpdateItem.pm +++ b/Koha/BackgroundJob/BatchUpdateItem.pm @@ -173,9 +173,9 @@ Sent the infos to generate the table containing the details of the modified item sub additional_report { my ( $self, $args ) = @_; - my $job = Koha::BackgroundJobs->find( $args->{job_id} ); + return unless $self->report->{modified_itemnumbers}; - my $itemnumbers = $job->report->{modified_itemnumbers}; + my $itemnumbers = $self->report->{modified_itemnumbers}; if ( scalar(@$itemnumbers) > C4::Context->preference('MaxItemsToDisplayForBatchMod') ) { return { too_many_items_display => 1 }; } else { -- 2.39.5