CustomVariables: do not replace vars on modification
This commit is contained in:
parent
7aba7fdb5f
commit
a2790652ec
|
@ -71,11 +71,16 @@ class CustomVariables implements Iterator, Countable, IcingaConfigRenderer
|
||||||
$value = CustomVariable::create($key, $value);
|
$value = CustomVariable::create($key, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->$key) && $value->equals($this->get($key))) {
|
if (isset($this->$key)) {
|
||||||
|
if ($value->equals($this->get($key))) {
|
||||||
return $this;
|
return $this;
|
||||||
|
} else {
|
||||||
|
$this->vars[$key]->setValue($value->getValue());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->vars[$key] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->vars[$key] = $value;
|
|
||||||
$this->modified = true;
|
$this->modified = true;
|
||||||
$this->refreshIndex();
|
$this->refreshIndex();
|
||||||
|
|
||||||
|
@ -105,7 +110,6 @@ class CustomVariables implements Iterator, Countable, IcingaConfigRenderer
|
||||||
$vars->vars[$row->varname] = CustomVariable::fromDbRow($row);
|
$vars->vars[$row->varname] = CustomVariable::fromDbRow($row);
|
||||||
}
|
}
|
||||||
$vars->refreshIndex();
|
$vars->refreshIndex();
|
||||||
|
|
||||||
return $vars;
|
return $vars;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue