Tests: CTI-Test gefixt
[kivitendo-erp.git] / SL / Controller / CsvImport / Base.pm
index 7030b05..e904989 100644 (file)
@@ -339,6 +339,10 @@ sub check_objects {
 sub check_duplicates {
 }
 
+sub check_auth {
+  $::auth->assert('config');
+}
+
 sub check_std_duplicates {
   my $self = shift;
 
@@ -461,7 +465,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
@@ -485,6 +489,7 @@ sub save_objects {
           $self->controller->num_imported($self->controller->num_imported + 1);
         }
       }
+      1;
     }) or do { die SL::DB->client->error };
   }
   $self->controller->track_progress(progress => 100);