From: Moritz Bunkus Date: Wed, 14 Feb 2007 12:16:06 +0000 (+0000) Subject: Zyklencheck war falsch. X-Git-Tag: release-2.4.2~108 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ad876674a8f9f132739884692b1aa0bb87859e89;p=kivitendo-erp.git Zyklencheck war falsch. --- diff --git a/SL/DBUpgrade2.pm b/SL/DBUpgrade2.pm index 514448f6d..b63b74903 100644 --- a/SL/DBUpgrade2.pm +++ b/SL/DBUpgrade2.pm @@ -103,14 +103,20 @@ sub _check_for_loops { push(@path, $tag); - _control_error($form, $file_name, - $main::locale->text("Dependency loop detected:") . - " " . join(" -> ", @path)) - if ($controls->{$tag}->{"loop"}); - - $controls->{$tag}->{"loop"} = 1; - map({ _check_for_loops($form, $file_name, $controls, $_, @path); } - @{$controls->{$tag}->{"depends"}}); + my $ctrl = $controls->{$tag}; + + if ($ctrl->{"loop"} == 1) { + # Not done yet. + _control_error($form, $file_name, + $main::locale->text("Dependency loop detected:") . + " " . join(" -> ", @path)) + } elsif ($ctrl->{"loop"} == 0) { + # Not checked yet. + $ctrl->{"loop"} = 1; + map({ _check_for_loops($form, $file_name, $controls, $_, @path); } + @{ $ctrl->{"depends"} }); + $ctrl->{"loop"} = 2; + } } sub _control_error {