diff --git a/CHANGELOG b/CHANGELOG index 5c1f7531b6..ce3dd04e11 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ Cacti CHANGELOG 1.2.4 -issue#2590: Language selection is not working as expected +-issue#2604: SQL error when add a dataquery -issue#2605: When checking for tables to upgrade, undefined variable $config error occurs -issue#2608: db_update_table() function should not require an engine type or comment -issue#2609: SQL error if upgrade cacti from pre-1.2.0 diff --git a/data_queries.php b/data_queries.php index 33b9f2dbba..1738e9d83f 100644 --- a/data_queries.php +++ b/data_queries.php @@ -140,7 +140,9 @@ function form_save() { if ($snmp_query_id) { raise_message(1); - data_query_update_input_method($snmp_query_id, $previous_input_id, $save['data_input_id']); + if (isset($previous_input_id) && $previous_input_id > 0) { + data_query_update_input_method($snmp_query_id, $previous_input_id, $save['data_input_id']); + } update_replication_crc(0, 'poller_replicate_snmp_query_crc'); } else {