Skip to content

Commit

Permalink
Fixing #5485 - SQL Error in Utilities
Browse files Browse the repository at this point in the history
Selecting a host device in System Utilities - View Data Query Cache raises error in cacti log
  • Loading branch information
TheWitness committed Sep 23, 2023
1 parent f24f2de commit ac240e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Cacti CHANGELOG
1.2.26
-issue#5481: Attempting to edit a Data Query that does not exist throws warnings and not an GUI error
-issue#5483: cacti 1.2.25 ubuntu server 22.04.3 php8.1 add device error
-issue#5485: Selecting a host device in System Utilities - View Data Query Cache raises error in cacti log
-issue#5489: remove_graphs.php does not handle "--preserve" option
-issue#5493: Multi select drop down list box not rendered correctly in Chrome and Edge
-issue#5494: typo error in name used in inserts array for selective_plugin_debug
Expand Down
12 changes: 7 additions & 5 deletions utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -647,18 +647,20 @@ function clearFilter() {
$snmp_queries = db_fetch_assoc('SELECT DISTINCT sq.id, sq.name
FROM host_snmp_cache AS hsc
INNER JOIN snmp_query AS sq
ON hsc.snmp_query_id=sq.id
ON hsc.snmp_query_id = sq.id
INNER JOIN host AS h
ON hsc.host_id=h.id
ON hsc.host_id = h.id
ORDER by sq.name');
} else {
$snmp_queries = db_fetch_assoc_prepared('SELECT DISTINCT sq.id, sq.name
FROM host_snmp_cache AS hsc
INNER JOIN snmp_query AS sq
ON hsc.snmp_query_id=sq.id
ON hsc.snmp_query_id = sq.id
INNER JOIN host AS h
ON hsc.host_id=h.id
ORDER by sq.name', array(get_request_var('host_id')));
ON hsc.host_id = h.id
WHERE h.id = ?
ORDER by sq.name",
array(get_request_var('host_id')));
}

if (cacti_sizeof($snmp_queries)) {
Expand Down

0 comments on commit ac240e0

Please sign in to comment.