diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php index 3c1b9e27d2..4d07c381db 100644 --- a/pandora_console/include/functions_networkmap.php +++ b/pandora_console/include/functions_networkmap.php @@ -409,19 +409,6 @@ function networkmap_generate_dot ($pandora_name, $group = 0, } } - // Addded the relationship of parents of agents - foreach ($agents as $agent) { - if ($agent['id_parent'] != "0" && - array_key_exists($agent['id_parent'], $node_ref)) { - - - $parents[$node_ref[$agent['id_agente']]] = $node_ref[$agent['id_parent']]; - } - else { - $orphans[$node_ref[$agent['id_agente']]] = 1; - } - } - // Drop the modules without a partner if l2_network is true // and the snmp interfaces token is false if ($l2_network) { @@ -450,6 +437,19 @@ function networkmap_generate_dot ($pandora_name, $group = 0, } } } + } else { + // Addded the relationship of parents of agents + foreach ($agents as $agent) { + if ($agent['id_parent'] != "0" && + array_key_exists($agent['id_parent'], $node_ref)) { + + + $parents[$node_ref[$agent['id_agente']]] = $node_ref[$agent['id_parent']]; + } + else { + $orphans[$node_ref[$agent['id_agente']]] = 1; + } + } } // Create void statistics array