From 6305d13a8673f5bb0d5163049aef1c275c893a84 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Wed, 30 Aug 2023 11:57:40 +0200 Subject: [PATCH] #11964 Fix snmp alerts editor --- pandora_console/godmode/alerts/alert_commands.php | 4 ++-- pandora_console/godmode/snmpconsole/snmp_alert.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index 75a80d8d57..b6231544d1 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -97,7 +97,7 @@ if (is_ajax()) { if (!empty($field_description)) { // If the value is 5, this because severity in snmp alerts is not permit to show. - if (($i > 5) && ($command['id'] == 3)) { + if (($i > 5) && ($command['id'] === 3)) { $fdesc = $field_description.'
'.sprintf( __('Field %s'), ($i - 1) @@ -118,7 +118,7 @@ if (is_ajax()) { } } else { // If the macro hasn't description and doesnt appear in command, set with empty description to dont show it. - if (($i > 5) && ($command['id'] == 3)) { + if (($i > 5) && ($command['id'] === 3)) { if (substr_count($command['command'], '_field'.($i - 1).'_') > 0) { $fdesc = sprintf(__('Field %s'), ($i - 1)); } else { diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php index d23b65d7ea..2c139e4f21 100755 --- a/pandora_console/godmode/snmpconsole/snmp_alert.php +++ b/pandora_console/godmode/snmpconsole/snmp_alert.php @@ -2312,7 +2312,7 @@ $(document).ready (function () { // The row provided has a predefined class. We delete it. $('#table_macros-field' + i) .removeAttr('class'); - if(old_value && i != 4){ + if(old_value){ $("[name=field" + i + "_value]").val(old_value).trigger('change'); } $('#table_macros-field').show();