Skip to content

Commit

Permalink
ObjectImporter: Retransform sync job settings apply_changes from bo…
Browse files Browse the repository at this point in the history
…olean to 'y' or 'n'
  • Loading branch information
raviks789 committed Aug 7, 2024
1 parent 428a49f commit a5c189c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions library/Director/Data/ObjectImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

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;
Expand Down Expand Up @@ -106,9 +107,13 @@ protected function fixRelations(string $implementation, stdClass $plain)
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);
}
}
}
Expand Down

0 comments on commit a5c189c

Please sign in to comment.