From: Thomas Heck Date: Mon, 3 Jun 2013 13:14:31 +0000 (+0200) Subject: CustomVariables-Helper registrieren von neu erstellen CVars X-Git-Tag: release-3.1.0beta1~161^2^2~39 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d453cc01303ea4a4a88505f0b98c8ca9fc01141a;p=kivitendo-erp.git CustomVariables-Helper registrieren von neu erstellen CVars SL::DB::Helper::CustomVariables::cvars_by_config fügt neue CVars dem ursprünglichen Objekt hinzu. --- diff --git a/SL/DB/Helper/CustomVariables.pm b/SL/DB/Helper/CustomVariables.pm index df90aa73b..3c43624db 100644 --- a/SL/DB/Helper/CustomVariables.pm +++ b/SL/DB/Helper/CustomVariables.pm @@ -78,7 +78,19 @@ sub make_cvar_by_configs { my $cvars = $self->custom_variables; my %cvars_by_config = map { $_->config_id => $_ } @$cvars; - my @return = map { $cvars_by_config{$_->id} || _new_cvar($self, %params, config => $_) } @$configs; + my @return = map( + { + if ( $cvars_by_config{$_->id} ) { + $cvars_by_config{$_->id}; + } + else { + my $cvar = _new_cvar($self, %params, config => $_); + $self->add_custom_variables($cvar); + $cvar; + } + } + @$configs + ); return \@return; }