Zyklencheck war falsch.
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 14 Feb 2007 12:16:06 +0000 (12:16 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 14 Feb 2007 12:16:06 +0000 (12:16 +0000)
SL/DBUpgrade2.pm

index 514448f..b63b749 100644 (file)
@@ -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 {