mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 16:54:06 +02:00
CustomVariables: improve modification handling
This commit is contained in:
parent
eabd848d5f
commit
1936ad8997
@ -75,7 +75,11 @@ class CustomVariables implements Iterator, Countable, IcingaConfigRenderer
|
||||
if ($value->equals($this->get($key))) {
|
||||
return $this;
|
||||
} else {
|
||||
$this->vars[$key]->setValue($value->getValue());
|
||||
if (get_class($this->vars[$key]) === get_class($value)) {
|
||||
$this->vars[$key]->setValue($value->getValue());
|
||||
} else {
|
||||
$this->vars[$key] = $value->setLoadedFromDb()->setModified();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->vars[$key] = $value;
|
||||
@ -115,6 +119,7 @@ class CustomVariables implements Iterator, Countable, IcingaConfigRenderer
|
||||
$vars->vars[$row->varname] = CustomVariable::fromDbRow($row);
|
||||
}
|
||||
$vars->refreshIndex();
|
||||
$vars->setUnmodified();
|
||||
return $vars;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user