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

(-)a/C4/ImportBatch.pm (-11 / +13 lines)
Lines 1724-1744 sub _update_batch_record_counts { Link Here
1724
    my ($batch_id) = @_;
1724
    my ($batch_id) = @_;
1725
1725
1726
    my $dbh = C4::Context->dbh;
1726
    my $dbh = C4::Context->dbh;
1727
    my $sth = $dbh->prepare_cached("UPDATE import_batches SET
1727
    my ( $num_records ) = $dbh->selectrow_array(q|
1728
                                        num_records = (
1729
                                            SELECT COUNT(*)
1728
                                            SELECT COUNT(*)
1730
                                            FROM import_records
1729
                                            FROM import_records
1731
                                            WHERE import_batch_id = import_batches.import_batch_id),
1730
                                            WHERE import_batch_id = ?
1732
                                        num_items = (
1731
    |, undef, $batch_id );
1732
    my ( $num_items ) = $dbh->selectrow_array(q|
1733
                                            SELECT COUNT(*)
1733
                                            SELECT COUNT(*)
1734
                                            FROM import_records
1734
                                            FROM import_records
1735
                                            JOIN import_items USING (import_record_id)
1735
                                            JOIN import_items USING (import_record_id)
1736
                                            WHERE import_batch_id = import_batches.import_batch_id
1736
                                            WHERE import_batch_id = ? AND record_type = 'biblio'
1737
                                            AND record_type = 'biblio')
1737
    |, undef, $batch_id );
1738
                                    WHERE import_batch_id = ?");
1738
    $dbh->do(
1739
    $sth->bind_param(1, $batch_id);
1739
        "UPDATE import_batches SET num_records=?, num_items=? WHERE import_batch_id=?",
1740
    $sth->execute();
1740
        undef,
1741
    $sth->finish();
1741
        $num_records,
1742
        $num_items,
1743
        $batch_id,
1744
    );
1742
}
1745
}
1743
1746
1744
sub _get_commit_action {
1747
sub _get_commit_action {
1745
- 

Return to bug 32990