Skip to content

Commit

Permalink
fix #5705 - unknown column disabled (#5706)
Browse files Browse the repository at this point in the history
* fix #5705 - unknown column disabled

* update

* revert

* db_fetch_row vs. db_fetch_cell

---------

Co-authored-by: TheWitness <thewitness@cacti.net>
  • Loading branch information
xmacan and TheWitness committed Mar 30, 2024
1 parent ce76033 commit b07794c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Expand Up @@ -61,7 +61,7 @@ Cacti CHANGELOG
-issue#5602: When adding a device, using the bulk walk option can make version information appear
-issue#5609: When parsing a Data Query resource, an error can be reported if no direction is specified
-issue#5612: Database reconnection can cause errors to be reported incorrectly
-issue#5613: fix returned value if $sau is empty
-issue#5613: Fix returned value if $sau is empty
-issue#5641: Cmd poller - add availability test for devices without poller items
-feature#5577: Add Aruba switch, Aruba controller and HPE iLO templates
-feature#5597: Add OSCX 6x00 templates
Expand Down
14 changes: 12 additions & 2 deletions lib/html.php
Expand Up @@ -308,7 +308,12 @@ function html_graph_area(&$graph_array, $no_graphs_message = '', $extra_url_args

foreach ($graph_array as $graph) {
if (!isset($graph['host_id'])) {
list($graph['host_id'], $graph['disabled']) = db_fetch_cell_prepared('SELECT host_id, disabled FROM graph_local WHERE id = ?', array($graph['local_graph_id']));
list($graph['host_id'], $graph['disabled']) = db_fetch_row_prepared('SELECT host_id, disabled
FROM graph_local AS gl
LEFT JOIN host AS h
ON gl.host_id = h.id
WHERE gl.id = ?',
array($graph['local_graph_id']));
}

if ($i == 0) {
Expand Down Expand Up @@ -392,7 +397,12 @@ function html_graph_thumbnail_area(&$graph_array, $no_graphs_message = '', $extr
$start = true;
foreach ($graph_array as $graph) {
if (!isset($graph['host_id'])) {
list($graph['host_id'], $graph['disabled']) = db_fetch_cell_prepared('SELECT host_id, disabled FROM graph_local WHERE id = ?', array($graph['local_graph_id']));
list($graph['host_id'], $graph['disabled']) = db_fetch_row_prepared('SELECT host_id, disabled
FROM graph_local AS gl
LEFT JOIN host AS h
ON gl.host_id = h.id
WHERE gl.id = ?',
array($graph['local_graph_id']));
}

if (isset($graph['graph_template_name'])) {
Expand Down

0 comments on commit b07794c

Please sign in to comment.