From: Martin Helmling martin.helmling@octosoft.eu Date: Fri, 2 Sep 2016 15:25:11 +0000 (+0200) Subject: CSV-Import: single-dbh X-Git-Tag: release-3.5.4~2063 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=df71b4750efd8607a7852b25f26a3b121a8ee7a1;p=kivitendo-erp.git CSV-Import: single-dbh --- diff --git a/SL/Controller/CsvImport/Base.pm b/SL/Controller/CsvImport/Base.pm index 2fa788753..17a3bfdd6 100644 --- a/SL/Controller/CsvImport/Base.pm +++ b/SL/Controller/CsvImport/Base.pm @@ -461,7 +461,7 @@ sub save_objects { $self->controller->track_progress(phase => 'saving data', progress => 0); # scale from 45..95%; - my $dbh = $data->[0]{object}->db; + my $dbh = $data->[0]{object}->db->dbh; my $last_index = $#$data; my $chunk_size = 100; # one transaction and progress update every 100 objects diff --git a/SL/Controller/CsvImport/Inventory.pm b/SL/Controller/CsvImport/Inventory.pm index a6e900189..238abf33a 100644 --- a/SL/Controller/CsvImport/Inventory.pm +++ b/SL/Controller/CsvImport/Inventory.pm @@ -395,7 +395,7 @@ sub save_objects { my $data = $params{data} || $self->controller->data; foreach my $entry (@{ $data }) { - my ($trans_id) = selectrow_query($::form, $::form->get_standard_dbh, qq|SELECT nextval('id')|); + my ($trans_id) = selectrow_query($::form,$entry->{object}->db->dbh, qq|SELECT nextval('id')|); $entry->{object}->trans_id($trans_id); } @@ -424,7 +424,7 @@ SQL $object->chargenumber); push @values, $object->bestbefore if $bestbefore_val_cnt; - my ($stocked_qty) = selectrow_query($::form, $::form->get_standard_dbh, $query, @values); + my ($stocked_qty) = selectrow_query($::form, $object->db->dbh, $query, @values); return $stocked_qty; }