mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 08:14:04 +02:00
DirectorObjectForm: be careful when continuing...
...after an exception
This commit is contained in:
parent
cbb3c7aa88
commit
a30f34a026
@ -131,13 +131,15 @@ abstract class DirectorObjectForm extends QuickForm
|
||||
if ($el = $this->getElement($key)) {
|
||||
if (array_key_exists($key, $post)) {
|
||||
$this->populate(array($key => $post[$key]));
|
||||
|
||||
$old = null;
|
||||
try {
|
||||
$old = $object->get($key);
|
||||
$object->set($key, $el->getValue());
|
||||
$object->resolveUnresolvedRelatedProperties();
|
||||
} catch (Exception $e) {
|
||||
if ($old !== null) {
|
||||
$object->set($key, $old);
|
||||
}
|
||||
$this->addException($e, $key);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user