From 1a3920a1f7f2a75da8ae6db91f6c2a57e88b95ad Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 16 Jan 2013 11:59:42 +0100 Subject: [PATCH] CSV-Import Lieferadressen: Funktion gefixt Shipto hat keine custom variables. Die Base-Klasse hat sich aber darauf verlassen, indem es 'all_cvar_configs' aufruft. Der Test mit '$self->can("all_cvar_configs")' ist hier sinnfrei, weil Rose::Object::MethodMaker nun mal genau diese Methoden anlegt. --- SL/Controller/CsvImport/Base.pm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/SL/Controller/CsvImport/Base.pm b/SL/Controller/CsvImport/Base.pm index 185c7adde..5f7e95e0e 100644 --- a/SL/Controller/CsvImport/Base.pm +++ b/SL/Controller/CsvImport/Base.pm @@ -122,6 +122,11 @@ sub add_cvar_raw_data_columns { map { $self->add_raw_data_columns($_) if exists $self->controller->data->[0]->{raw_data}->{$_} } @{ $self->cvar_columns }; } +sub init_all_cvar_configs { + # Must be overridden by derived specialized importer classes. + return []; +} + sub init_cvar_columns { my ($self) = @_; @@ -191,8 +196,6 @@ sub check_vc { sub handle_cvars { my ($self, $entry) = @_; - return unless $self->can('all_cvar_configs'); - my %type_to_column = ( text => 'text_value', textfield => 'text_value', select => 'text_value', @@ -231,11 +234,7 @@ sub init_profile { $profile{$col} = $name; } - if ($self->can('all_cvar_configs')) { - for (@{ $self->all_cvar_configs }) { - $profile{ 'cvar_' . $_->name } = ''; - } - } + $profile{ 'cvar_' . $_->name } = '' for @{ $self->all_cvar_configs }; \%profile; } @@ -266,8 +265,6 @@ sub setup_displayable_columns { sub add_cvar_columns_to_displayable_columns { my ($self) = @_; - return unless $self->can('all_cvar_configs'); - $self->add_displayable_columns(map { { name => 'cvar_' . $_->name, description => $::locale->text('#1 (custom variable)', $_->description) } } @{ $self->all_cvar_configs }); -- 2.20.1