From 0ec7590940218fbeaf500753efcffd1bba53124e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 22 Mar 2016 13:00:17 +0100 Subject: [PATCH] warnings: diverse nicht initialisierte hash keys in CsvImport --- SL/Controller/CsvImport/Base.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SL/Controller/CsvImport/Base.pm b/SL/Controller/CsvImport/Base.pm index c8456cafa..8544cf79d 100644 --- a/SL/Controller/CsvImport/Base.pm +++ b/SL/Controller/CsvImport/Base.pm @@ -200,8 +200,8 @@ sub check_vc { } if (!$entry->{object}->$id_column) { - my $vc = $self->vc_by->{number}->{customers}->{ $entry->{raw_data}->{customernumber} } - || $self->vc_by->{number}->{vendors}->{ $entry->{raw_data}->{vendornumber} }; + my $vc = ($entry->{raw_data}->{customernumber} && $self->vc_by->{number}->{customers}->{ $entry->{raw_data}->{customernumber} }) + || ($entry->{raw_data}->{vendornumber} && $self->vc_by->{number}->{vendors}->{ $entry->{raw_data}->{vendornumber} }); $entry->{object}->$id_column($vc->id) if $vc; } @@ -522,7 +522,7 @@ sub clean_fields { sub _save_history { my ($self, $object) = @_; - if (any { $_ eq $self->controller->{type} } qw(parts customers_vendors orders ar_transactions)) { + if (any { $self->controller->{type} && $_ eq $self->controller->{type} } qw(parts customers_vendors orders ar_transactions)) { my $snumbers = $self->controller->{type} eq 'parts' ? 'partnumber_' . $object->partnumber : $self->controller->{type} eq 'customers_vendors' ? ($self->table eq 'customer' ? 'customernumber_' . $object->customernumber : 'vendornumber_' . $object->vendornumber) -- 2.20.1