From ad876674a8f9f132739884692b1aa0bb87859e89 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 14 Feb 2007 12:16:06 +0000 Subject: [PATCH] Zyklencheck war falsch. --- SL/DBUpgrade2.pm | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) 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 { -- 2.20.1