From ac240e05f215af5ae634b0c3be5bb11ad74c8837 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Sat, 23 Sep 2023 11:31:18 -0400 Subject: [PATCH] Fixing #5485 - SQL Error in Utilities Selecting a host device in System Utilities - View Data Query Cache raises error in cacti log --- CHANGELOG | 1 + utilities.php | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index c404b03191..67ba6aacac 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/utilities.php b/utilities.php index 710730f4e3..bb8665659d 100644 --- a/utilities.php +++ b/utilities.php @@ -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)) {