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 459-464 sub batch_update { Link Here
459
459
460
    my ( @modified_itemnumbers, $modified_fields );
460
    my ( @modified_itemnumbers, $modified_fields );
461
    my $i;
461
    my $i;
462
    my @errors;
462
    my $schema = Koha::Database->new->schema;
463
    my $schema = Koha::Database->new->schema;
463
    while ( my $item = $self->next ) {
464
    while ( my $item = $self->next ) {
464
465
Lines 578-583 sub batch_update { Link Here
578
                }
579
                }
579
            )
580
            )
580
        } catch {
581
        } catch {
582
            push @errors, {
583
                error => eval { $_->{error} } || "$_",
584
            };
581
            warn $_
585
            warn $_
582
        };
586
        };
583
587
Lines 600-606 sub batch_update { Link Here
600
        }
604
        }
601
    }
605
    }
602
606
603
    return ( { modified_itemnumbers => \@modified_itemnumbers, modified_fields => $modified_fields }, $self );
607
    return (
608
        { modified_itemnumbers => \@modified_itemnumbers, modified_fields => $modified_fields, errors => \@errors },
609
        $self
610
    );
604
}
611
}
605
612
606
=head2 apply_regex
613
=head2 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