r1384 + bugfix: Live VLANs displayed VLANs missing from switch table improperly
authorDenis Ovsienko <infrastation@yandex.ru>
Thu, 13 Dec 2007 17:56:29 +0000 (17:56 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Thu, 13 Dec 2007 17:56:29 +0000 (17:56 +0000)
ChangeLog
inc/interface.php

index 87e4b4e..891f7f4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
        bugfix: Cisco connector: tolerate switch ports in suspended state
        bugfix: nameless object in link list could not be clicked
        bugfix: fix SQL tables structure
+       bugfix: Live VLANs displayed VLANs missing from switch table improperly
        update: corrected some dictionary entries
        update: better layout for Live VLANs tab
        new feature: UI option to control asset tag warning
index 38b4e22..ffffa7b 100644 (file)
@@ -3075,13 +3075,21 @@ function renderVLANMembership ($object_id = 0)
                else
                {
                        echo "<select name=vlanid_${portno}>";
+                       // A port may belong to a VLAN, which is absent from the VLAN table, this is normal.
+                       // We must be able to render its SELECT properly at least.
+                       $in_table = FALSE;
                        foreach ($vlanlist as $v => $d)
                        {
                                echo "<option value=${v}";
                                if ($v == $port['vlanid'])
+                               {
                                        echo ' selected';
-                               echo ">${v}</option>";
+                                       $in_table = TRUE;
+                               }
+                               echo ">${v}</option>\n";
                        }
+                       if (!$in_table)
+                               echo "<option value=${port['vlanid']} selected>${port['vlanid']}</option>\n";
                        echo "</select>";
                }
                $portno++;