Details
Description
We pull billing graphs from observium via graph.php, for example:
/graph.php?type=bill_bits&from=-3d&to=now&id=61&width=600&height=200&total=1
This was working fine until recently. When adding &debug=1, observium throws an error message:
SELECT * FROM `bill_ports` AS B, `ports` AS P, `devices` AS D WHERE B.bill_id = '61' AND P.port_id = B.port_id AND D.device_id = P.device_id
Error in query: (Table 'observium.bill_ports' doesn't exist) 1146
bill_ports table doesnt exist anymore, because it was renamed with schema update 281.sql:
RENAME TABLE `bill_ports` TO `bill_entities` ;
Changing
$ports = dbFetchRows("SELECT * FROM `bill_ports` AS B, `ports` AS P, `devices` AS D WHERE B.bill_id = ? AND P.port_id = B.port_id AND D.device_id = P.device_id", array($_GET['id
']));
to
$ports = dbFetchRows("SELECT * FROM `bill_entities` AS B, `ports` AS P, `devices` AS D WHERE B.bill_id = ? AND P.port_id = B.entity_id AND D.device_id = P.device_id", array($_GET['id
']));
in /html/includes/graphs/bill/auth.inc.php seems to fix this.