From 9659bb322bb46594640c34d3416a736801e0cc64 Mon Sep 17 00:00:00 2001 From: Eldon Koyle Date: Wed, 2 Dec 2015 17:07:32 -0700 Subject: [PATCH] Fix map bug caused by loopback cable Fix a map bug where vis.js aborts because a device is inserted twice. Need to add to $tmp_ids before checking the next device. --- html/includes/print-map.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/includes/print-map.inc.php b/html/includes/print-map.inc.php index d512a7e21..515fc68f4 100644 --- a/html/includes/print-map.inc.php +++ b/html/includes/print-map.inc.php @@ -132,10 +132,10 @@ foreach ($list as $items) { if (!in_array($items['local_device_id'],$tmp_ids)) { $tmp_devices[] = array('id'=>$items['local_device_id'],'label'=>$items['local_hostname'],'title'=>generate_device_link($local_device,'',array(),'','','',0),'shape'=>'box'); } + array_push($tmp_ids,$items['local_device_id']); if (!in_array($items['remote_device_id'],$tmp_ids)) { $tmp_devices[] = array('id'=>$items['remote_device_id'],'label'=>$items['remote_hostname'],'title'=>generate_device_link($remote_device,'',array(),'','','',0),'shape'=>'box'); } - array_push($tmp_ids,$items['local_device_id']); array_push($tmp_ids,$items['remote_device_id']); $speed = $items['local_ifspeed']/1000/1000; if ($speed == 100) {