strict_profile => 1,
map { ( $_ => $self->controller->profile->get($_) ) } qw(sep_char escape_char quote_char),
));
+
+ my $old_numberformat = $::myconfig{numberformat};
+ $::myconfig{numberformat} = $self->controller->profile->get('numberformat');
+
$self->csv->parse;
$self->controller->errors([ $self->csv->errors ]) if $self->csv->errors;
$self->check_objects;
$self->check_duplicates if $self->controller->profile->get('duplicates', 'no_check') ne 'no_check';
$self->fix_field_lengths;
+
+ $::myconfig{numberformat} = $old_numberformat;
}
sub add_columns {
foreach my $entry (@{ $data }) {
next if @{ $entry->{errors} };
- if (!$entry->{object}->save) {
+ my $object = $entry->{object_to_save} || $entry->{object};
+
+ if (!$object->save) {
push @{ $entry->{errors} }, $::locale->text('Error when saving: #1', $entry->{object}->db->error);
} else {
$self->controller->num_imported($self->controller->num_imported + 1);