Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-1875

graph.php bill_bits not working

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • Professional Edition
    • Billing
    • Observium Professional 0.16.6.7919

    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.

      Attachments

        Activity

          People

            adama Adam Armstrong
            cze Christian Zeng
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: