View | Details | Raw Unified | Return to bug 23010
Collapse All | Expand All

(-)a/Koha/BackgroundJob/BatchUpdateItem.pm (-1 / +1 lines)
Lines 113-118 sub process { Link Here
113
                callback                          => sub { $self->step; },
113
                callback                          => sub { $self->step; },
114
            }
114
            }
115
        );
115
        );
116
        $report->{errors}               = $results->{errors};
116
        $report->{modified_itemnumbers} = $results->{modified_itemnumbers};
117
        $report->{modified_itemnumbers} = $results->{modified_itemnumbers};
117
        $report->{modified_fields}      = $results->{modified_fields};
118
        $report->{modified_fields}      = $results->{modified_fields};
118
    } catch {
119
    } catch {
Lines 123-129 sub process { Link Here
123
124
124
    my $data = $self->decoded_data;
125
    my $data = $self->decoded_data;
125
    $data->{report} = $report;
126
    $data->{report} = $report;
126
127
    $self->finish($data);
127
    $self->finish($data);
128
}
128
}
129
129
(-)a/Koha/Items.pm (-1 / +8 lines)
Lines 317-322 sub batch_update { Link Here
317
317
318
    my ( @modified_itemnumbers, $modified_fields );
318
    my ( @modified_itemnumbers, $modified_fields );
319
    my $i;
319
    my $i;
320
    my @errors;
320
    my $schema = Koha::Database->new->schema;
321
    my $schema = Koha::Database->new->schema;
321
    while ( my $item = $self->next ) {
322
    while ( my $item = $self->next ) {
322
323
Lines 436-441 sub batch_update { Link Here
436
                }
437
                }
437
            )
438
            )
438
        } catch {
439
        } catch {
440
            push @errors, {
441
                error => eval { $_->{error} } || "$_",
442
            };
439
            warn $_
443
            warn $_
440
        };
444
        };
441
445
Lines 458-464 sub batch_update { Link Here
458
        }
462
        }
459
    }
463
    }
460
464
461
    return ( { modified_itemnumbers => \@modified_itemnumbers, modified_fields => $modified_fields }, $self );
465
    return (
466
        { modified_itemnumbers => \@modified_itemnumbers, modified_fields => $modified_fields, errors => \@errors },
467
        $self
468
    );
462
}
469
}
463
470
464
sub apply_regex {
471
sub apply_regex {
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/batch_item_record_modification.inc (-1 / +7 lines)
Lines 13-18 Link Here
13
            [% IF job.status == 'cancelled' %]<span>The job has been cancelled before it finished.</span>[% END %]
13
            [% IF job.status == 'cancelled' %]<span>The job has been cancelled before it finished.</span>[% END %]
14
            <a href="/cgi-bin/koha/tools/batchMod.pl" title="New batch item modification">New batch item modification</a>
14
            <a href="/cgi-bin/koha/tools/batchMod.pl" title="New batch item modification">New batch item modification</a>
15
        </div>
15
        </div>
16
        <div>
17
            [% IF report.errors.size %]
18
                <div class="alert alert-warning">
19
                    <span>[% report.errors.size | html %] item(s) could not be modified.</span>
20
                </div>
21
            [% END %]
22
        </div>
16
    [% END %]
23
    [% END %]
17
[% END %]
24
[% END %]
18
25
19
- 

Return to bug 23010