mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
ObjectImporter: Retransform sync job settings apply_changes
from boolean to 'y' or 'n' (#2904)
Sync jobs restored from a basket snapshot with `apply_changes` settings set to `Yes`, runs without applying any changes to the objects affected by the sync rule. This happens as the value of the setting is exported as a boolean but is not retransformed back to `y` or `n` while importing. fixes ref/IP/53326
This commit is contained in:
commit
aaf51452be
@ -4,6 +4,7 @@ namespace Icinga\Module\Director\Data;
|
||||
|
||||
use gipfl\Json\JsonDecodeException;
|
||||
use gipfl\Json\JsonString;
|
||||
use Icinga\Module\Director\Data\Db\DbDataFormatter;
|
||||
use Icinga\Module\Director\Data\Db\DbObject;
|
||||
use Icinga\Module\Director\Db;
|
||||
use Icinga\Module\Director\DirectorObject\Automation\Basket;
|
||||
@ -106,9 +107,13 @@ class ObjectImporter
|
||||
unset($settings->source);
|
||||
}
|
||||
$rule = $settings->rule ?? null;
|
||||
if ($rule && !isset($settings->rule_id)) {
|
||||
$settings->rule_id = SyncRule::load($rule, $this->db)->get('id');
|
||||
unset($settings->rule);
|
||||
if ($rule) {
|
||||
if (! isset($settings->rule_id)) {
|
||||
$settings->rule_id = SyncRule::load($rule, $this->db)->get('id');
|
||||
unset($settings->rule);
|
||||
}
|
||||
|
||||
$settings->apply_changes = DbDataFormatter::normalizeBoolean($settings->apply_changes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user