mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 01:04:12 +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))) {
|
if ($value->equals($this->get($key))) {
|
||||||
return $this;
|
return $this;
|
||||||
} else {
|
} 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 {
|
} else {
|
||||||
$this->vars[$key] = $value;
|
$this->vars[$key] = $value;
|
||||||
@ -115,6 +119,7 @@ class CustomVariables implements Iterator, Countable, IcingaConfigRenderer
|
|||||||
$vars->vars[$row->varname] = CustomVariable::fromDbRow($row);
|
$vars->vars[$row->varname] = CustomVariable::fromDbRow($row);
|
||||||
}
|
}
|
||||||
$vars->refreshIndex();
|
$vars->refreshIndex();
|
||||||
|
$vars->setUnmodified();
|
||||||
return $vars;
|
return $vars;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user