From d1c73b14f3fe5963ff9205b4ac6ae6c68fc3d980 Mon Sep 17 00:00:00 2001 From: louis-oui <47607835+louis-oui@users.noreply.github.com> Date: Thu, 14 Nov 2019 20:36:01 +0100 Subject: [PATCH] Fixed maps display when multiple links are present between devices. (#10818) * Fix maps display only one link if multiple links are present between devices. * Simplify test mac in network_map_items --- includes/html/print-map.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/html/print-map.inc.php b/includes/html/print-map.inc.php index 8f2040f2b8..b0c1e0fc44 100644 --- a/includes/html/print-map.inc.php +++ b/includes/html/print-map.inc.php @@ -286,11 +286,13 @@ foreach ($list as $items) { $device_id1 = $items['local_device_id'].':'.$items['remote_device_id']; $device_id2 = $items['remote_device_id'].':'.$items['local_device_id']; - // Ensure only one link exists between any two ports, or any two devices. + // If mac is choosen to graph, ensure only one link exists between any two ports, or any two devices. + // else ensure only one link exists between any two ports if (!array_key_exists($link_id1, $link_assoc_seen) && !array_key_exists($link_id2, $link_assoc_seen) && - !array_key_exists($device_id1, $device_assoc_seen) && - !array_key_exists($device_id2, $device_assoc_seen)) { + (!in_array('mac', Config::get('network_map_items')) || + (!array_key_exists($device_id1, $device_assoc_seen) && + !array_key_exists($device_id2, $device_assoc_seen)))) { $local_port = cleanPort($local_port); $remote_port = cleanPort($remote_port); $links[] = array_merge(