From: Sven Schöling Date: Thu, 24 Feb 2011 10:41:50 +0000 (+0100) Subject: Csv/Dispatcher: dynamisches $class require schon im Specbuilder. X-Git-Tag: release-2.7.0beta1~396^2~70 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=7358571b41a1959461b53de83010443b4c9e12d1;p=kivitendo-erp.git Csv/Dispatcher: dynamisches $class require schon im Specbuilder. - Spart Zeit später - Kann abgefangen werden falls es Fehler gibt. --- diff --git a/SL/Helper/Csv/Dispatcher.pm b/SL/Helper/Csv/Dispatcher.pm index 9626fed25..a8d29fe45 100644 --- a/SL/Helper/Csv/Dispatcher.pm +++ b/SL/Helper/Csv/Dispatcher.pm @@ -36,7 +36,6 @@ sub apply { if ($class) { # autovifify - eval "require $class; 1" or die "could not load class '$class'"; if (defined $index) { if (! $obj->$acc || !$obj->$acc->[$index]) { my @objects = $obj->$acc; @@ -101,6 +100,7 @@ sub make_spec { my $next_class = $cur_class->meta->relationship($step)->class; push @{ $spec->{steps} }, [ $step, $next_class, $index ]; $cur_class = $next_class; + eval "require $cur_class; 1" or die "could not load class '$cur_class'"; } } else { # simple dispatch push @{ $spec->{steps} }, [ $step ];