View Issue Details

IDProjectCategoryView StatusLast Update
2029RackTablesdefaultpublic2021-07-13 20:59
Reporternetniv Assigned Toinfrastation  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.21.5 
Target Version0.22.0Fixed in Version0.22.0 
Summary2029: Undefined ios15xxx function in shortenIfName due to lack of deviceconfig.php inclusion
DescriptionBecause deviceconfig.php is not required before the use of shortenIfName, there are warnings displayed in the browser.
Steps To ReproduceHave a device that is identified as ios15, see the errors when using the device in rack especially on the port and links tab.
Additional Informationdiff --git a/wwwroot/inc/remote.php b/wwwroot/inc/remote.php
index 942975a9..08ad945b 100644
--- a/wwwroot/inc/remote.php
+++ b/wwwroot/inc/remote.php
@@ -766,6 +766,7 @@ function shortenIfName ($if_name, $breed = NULL, $object_id = NULL)
        if (preg_match ('/^AC-in(-[12])?$/', $if_name))
                return $if_name;

+ require_once 'deviceconfig.php';
        global $current_query_breed;
        global $shorten_by_breed;
        if (! isset ($breed))
TagsNo tags attached.
Attached Files
image.png (39,750 bytes)   
image.png (39,750 bytes)   

Activities

infrastation

infrastation

2021-07-10 13:10

administrator   ~0004309

Thank you for reporting this issue. Does the change below fix it fully?

diff --git a/wwwroot/inc/breed-ios15.php b/wwwroot/inc/breed-ios15.php
index ce76cd42..2f04c588 100644
--- a/wwwroot/inc/breed-ios15.php
+++ b/wwwroot/inc/breed-ios15.php
@@ -70,14 +70,3 @@ function ios15TranslatePushQueue ($dummy_object_id, $queue, $dummy_vlan_names)
    }
  return $ret;
 }
-
-function ios15ShortenIfName_real ($ifname)
-{
- $ifname = preg_replace ('@^FastEthernet(.+)$@', 'fa\\1', $ifname);
- $ifname = preg_replace ('@^GigabitEthernet(.+)$@', 'gi\\1', $ifname);
- $ifname = preg_replace ('@^TenGigabitEthernet(.+)$@', 'te\\1', $ifname);
- $ifname = preg_replace ('@^po([0-9]+)$@i', 'port-channel\\1', $ifname);
- $ifname = strtolower ($ifname);
- $ifname = preg_replace ('/^(fa|gi|te|po)\s+(\d.*)/', '$1$2', $ifname);
- return $ifname;
-}
diff --git a/wwwroot/inc/remote.php b/wwwroot/inc/remote.php
index 942975a9..1c5dc5ae 100644
--- a/wwwroot/inc/remote.php
+++ b/wwwroot/inc/remote.php
@@ -793,6 +793,13 @@ function ios12ShortenIfName_real ($ifname)
  return $ifname;
 }
 
+function ios15ShortenIfName_real ($ifname)
+{
+ return preg_match ('/^port-channel/i', $ifname) ?
+   strtolower ($ifname) :
+   ios12ShortenIfName_real ($ifname);
+}
+
 function nxos4ShortenIfName ($ifname)
 {
  $ifname = preg_replace ('@^(Ethernet|Eth)(.+)$@', 'e\\2', $ifname);
netniv

netniv

2021-07-13 17:25

reporter   ~0004315

Yes, that does seem to resolve the issue, but it seems inconsistent to move that one function when the rest are in the breed file unless that is how they all are (I didn't check)
infrastation

infrastation

2021-07-13 20:59

administrator   ~0004321

Thank you for confirming, a fix along those lines has been committed and will be available in the next release of RackTables.

Issue History

Date Modified Username Field Change
2021-07-09 21:47 netniv New Issue
2021-07-09 21:47 netniv File Added: image.png
2021-07-10 13:10 infrastation Note Added: 0004309
2021-07-10 13:12 infrastation Assigned To => infrastation
2021-07-10 13:12 infrastation Status new => assigned
2021-07-10 13:12 infrastation Product Version => 0.21.5
2021-07-10 13:12 infrastation Target Version => 0.22.0
2021-07-10 13:12 infrastation Description Updated
2021-07-10 13:12 infrastation Additional Information Updated
2021-07-13 17:25 netniv Note Added: 0004315
2021-07-13 20:59 infrastation Status assigned => closed
2021-07-13 20:59 infrastation Resolution open => fixed
2021-07-13 20:59 infrastation Fixed in Version => 0.22.0
2021-07-13 20:59 infrastation Note Added: 0004321