diff --git a/Koha/BackgroundJob/BatchUpdateItem.pm b/Koha/BackgroundJob/BatchUpdateItem.pm index 1158efd568..75250d6877 100644 --- a/Koha/BackgroundJob/BatchUpdateItem.pm +++ b/Koha/BackgroundJob/BatchUpdateItem.pm @@ -113,6 +113,7 @@ sub process { callback => sub { $self->step; }, } ); + $report->{errors} = $results->{errors}; $report->{modified_itemnumbers} = $results->{modified_itemnumbers}; $report->{modified_fields} = $results->{modified_fields}; } catch { @@ -123,7 +124,6 @@ sub process { my $data = $self->decoded_data; $data->{report} = $report; - $self->finish($data); } diff --git a/Koha/Items.pm b/Koha/Items.pm index 99429456be..7ac9f034ae 100644 --- a/Koha/Items.pm +++ b/Koha/Items.pm @@ -459,6 +459,7 @@ sub batch_update { my ( @modified_itemnumbers, $modified_fields ); my $i; + my @errors; my $schema = Koha::Database->new->schema; while ( my $item = $self->next ) { @@ -578,6 +579,9 @@ sub batch_update { } ) } catch { + push @errors, { + error => eval { $_->{error} } || "$_", + }; warn $_ }; @@ -600,7 +604,10 @@ sub batch_update { } } - return ( { modified_itemnumbers => \@modified_itemnumbers, modified_fields => $modified_fields }, $self ); + return ( + { modified_itemnumbers => \@modified_itemnumbers, modified_fields => $modified_fields, errors => \@errors }, + $self + ); } =head2 apply_regex diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/batch_item_record_modification.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/batch_item_record_modification.inc index ee3d09f25e..1ee3fd72cb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/batch_item_record_modification.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/batch_item_record_modification.inc @@ -13,6 +13,13 @@ [% IF job.status == 'cancelled' %]The job has been cancelled before it finished.[% END %] New batch item modification +