CustomVariable: more care when cloning
This commit is contained in:
parent
070d05d4a8
commit
2ba404c2c7
|
@ -89,7 +89,11 @@ abstract class CustomVariable implements IcingaConfigRenderer
|
|||
{
|
||||
$this->modified = $modified;
|
||||
if (! $this->modified) {
|
||||
$this->storedValue = clone($this->value);
|
||||
if (is_object($this->value)) {
|
||||
$this->storedValue = clone($this->value);
|
||||
} else {
|
||||
$this->storedValue = $this->value;
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
@ -180,7 +184,7 @@ abstract class CustomVariable implements IcingaConfigRenderer
|
|||
}
|
||||
|
||||
$var->loadedFromDb = true;
|
||||
$var->modified = false;
|
||||
$var->setUnmodified();
|
||||
return $var;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue