Bug 23010: Report on count of items not modified via batchMod
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ccf4bc0626)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
parent
af9615f3d9
commit
845171e4aa
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -13,6 +13,13 @@
|
|||
[% IF job.status == 'cancelled' %]<span>The job has been cancelled before it finished.</span>[% END %]
|
||||
<a href="/cgi-bin/koha/tools/batchMod.pl" title="New batch item modification">New batch item modification</a>
|
||||
</div>
|
||||
<div>
|
||||
[% IF report.errors.size %]
|
||||
<div class="alert alert-warning">
|
||||
<span>[% report.errors.size | html %] item(s) could not be modified.</span>
|
||||
</div>
|
||||
[% END %]
|
||||
</div>
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue