Change on the add_edit_rule to modify a rule without modify the name #2159

Merged
merged 2 commits into from Oct 16, 2015

Projects

None yet

3 participants

@PandaWawawa
Contributor

No description provided.

@PandaWawawa PandaWawawa Change on the add_edit_rule to modify a rule without modify the name
70aeb75
@laf laf commented on an outdated diff Oct 16, 2015
html/includes/api_functions.inc.php
@@ -693,8 +693,14 @@ function add_edit_rule() {
);
$extra_json = json_encode($extra);
- if (dbFetchCell('SELECT `name` FROM `alert_rules` WHERE `name`=?', array($name)) == $name) {
- $message = 'Name has already been used';
+ if(!isset($rule_id)) {
+ if (dbFetchCell('SELECT `name` FROM `alert_rules` WHERE `name`=?', array($name)) == $name) {
+ $message = 'Addition failed : Name has already been used';
+ }
+ }else {
@laf
laf Oct 16, 2015 Member

Can you pop the else { onto a new line like:

}
else {
@PandaWawawa PandaWawawa Change on the add_edit_rule to modify a rule without modify the name
9fef97f
@laf laf merged commit 8ff90eb into librenms:master Oct 16, 2015

2 checks passed

Auto-Deploy Build finished. No test results found.
Details
Scrutinizer 1 new issues
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment