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

(-)a/C4/ImportBatch.pm (-11 / +13 lines)
Lines 1710-1730 sub _update_batch_record_counts { Link Here
1710
    my ($batch_id) = @_;
1710
    my ($batch_id) = @_;
1711
1711
1712
    my $dbh = C4::Context->dbh;
1712
    my $dbh = C4::Context->dbh;
1713
    my $sth = $dbh->prepare_cached("UPDATE import_batches SET
1713
    my ( $num_records ) = $dbh->selectrow_array(q|
1714
                                        num_records = (
1715
                                            SELECT COUNT(*)
1714
                                            SELECT COUNT(*)
1716
                                            FROM import_records
1715
                                            FROM import_records
1717
                                            WHERE import_batch_id = import_batches.import_batch_id),
1716
                                            WHERE import_batch_id = ?
1718
                                        num_items = (
1717
    |, undef, $batch_id );
1718
    my ( $num_items ) = $dbh->selectrow_array(q|
1719
                                            SELECT COUNT(*)
1719
                                            SELECT COUNT(*)
1720
                                            FROM import_records
1720
                                            FROM import_records
1721
                                            JOIN import_items USING (import_record_id)
1721
                                            JOIN import_items USING (import_record_id)
1722
                                            WHERE import_batch_id = import_batches.import_batch_id
1722
                                            WHERE import_batch_id = ? AND record_type = 'biblio'
1723
                                            AND record_type = 'biblio')
1723
    |, undef, $batch_id );
1724
                                    WHERE import_batch_id = ?");
1724
    $dbh->do(
1725
    $sth->bind_param(1, $batch_id);
1725
        "UPDATE import_batches SET num_records=?, num_items=? WHERE import_batch_id=?",
1726
    $sth->execute();
1726
        undef,
1727
    $sth->finish();
1727
        $num_records,
1728
        $num_items,
1729
        $batch_id,
1730
    );
1728
}
1731
}
1729
1732
1730
sub _get_commit_action {
1733
sub _get_commit_action {
1731
- 

Return to bug 32990