Skip to content

Commit

Permalink
Fix device inventory page (librenms#8698)
Browse files Browse the repository at this point in the history
$device isn't global it is in the local scope.
  • Loading branch information
murrant authored and mattie47 committed Jul 2, 2018
1 parent 6c06cbf commit bc9b54e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions html/pages/device/entphysical.inc.php
@@ -1,10 +1,8 @@
<?php


function printEntPhysical($ent, $level, $class)
function printEntPhysical($device, $ent, $level, $class)
{
global $device;

$ents = dbFetchRows('SELECT * FROM `entPhysical` WHERE device_id = ? AND entPhysicalContainedIn = ? ORDER BY entPhysicalContainedIn,entPhysicalIndex', array($device['device_id'], $ent));

foreach ($ents as $ent) {
Expand Down Expand Up @@ -108,7 +106,7 @@ function printEntPhysical($ent, $level, $class)
$count = dbFetchCell("SELECT COUNT(*) FROM `entPhysical` WHERE device_id = '".$device['device_id']."' AND entPhysicalContainedIn = '".$ent['entPhysicalIndex']."'");
if ($count) {
echo '<ul>';
printEntPhysical($ent['entPhysicalIndex'], ($level + 1), '');
printEntPhysical($device, $ent['entPhysicalIndex'], ($level + 1), '');
echo '</ul>';
}

Expand All @@ -125,7 +123,7 @@ function printEntPhysical($ent, $level, $class)
echo "<div style='clear: both;'><UL CLASS='mktree' id='enttree'>";
$level = '0';
$ent['entPhysicalIndex'] = '0';
printEntPhysical($ent['entPhysicalIndex'], $level, 'liOpen');
printEntPhysical($device, $ent['entPhysicalIndex'], $level, 'liOpen');
echo '</ul></div>';

$pagetitle = 'Inventory';

0 comments on commit bc9b54e

Please sign in to comment.