mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
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)) {
|
||||||
return $this;
|
if ($value->equals($this->get($key))) {
|
||||||
|
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…
x
Reference in New Issue
Block a user