mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
Fix sync rule preview in case of boolean properties
This commit is contained in:
parent
340e3d550f
commit
409962251b
@ -3,10 +3,12 @@
|
|||||||
namespace Icinga\Module\Director\Db\Branch;
|
namespace Icinga\Module\Director\Db\Branch;
|
||||||
|
|
||||||
use Icinga\Exception\NotFoundError;
|
use Icinga\Exception\NotFoundError;
|
||||||
|
use Icinga\Module\Director\Data\Db\DbDataFormatter;
|
||||||
use Icinga\Module\Director\Data\Db\DbObject;
|
use Icinga\Module\Director\Data\Db\DbObject;
|
||||||
use Icinga\Module\Director\Data\Db\DbObjectTypeRegistry;
|
use Icinga\Module\Director\Data\Db\DbObjectTypeRegistry;
|
||||||
use Icinga\Module\Director\Data\Json;
|
use Icinga\Module\Director\Data\Json;
|
||||||
use Icinga\Module\Director\Db;
|
use Icinga\Module\Director\Db;
|
||||||
|
use Icinga\Module\Director\Objects\IcingaObject;
|
||||||
use Ramsey\Uuid\UuidInterface;
|
use Ramsey\Uuid\UuidInterface;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
|
|
||||||
@ -198,7 +200,17 @@ class BranchedObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$dummyObject = IcingaObject::createByType(
|
||||||
|
$this->objectTable,
|
||||||
|
[],
|
||||||
|
$connection
|
||||||
|
);
|
||||||
|
|
||||||
foreach ($activity->getModifiedProperties()->jsonSerialize() as $key => $value) {
|
foreach ($activity->getModifiedProperties()->jsonSerialize() as $key => $value) {
|
||||||
|
if ($dummyObject->propertyIsBoolean($key)) {
|
||||||
|
$value = DbDataFormatter::normalizeBoolean($value);
|
||||||
|
}
|
||||||
|
|
||||||
$this->changes[$key] = $value;
|
$this->changes[$key] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user