From f447457c40d22521ff2ba633a554adadbbe9bd22 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 6 Oct 2022 13:08:48 +0200 Subject: [PATCH] Sync: load object w/o branch support the old way fixes #2618 --- doc/82-Changelog.md | 1 + library/Director/Import/Sync.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/82-Changelog.md b/doc/82-Changelog.md index 12b0307f..0ccce60f 100644 --- a/doc/82-Changelog.md +++ b/doc/82-Changelog.md @@ -13,6 +13,7 @@ v1.10.1 (unreleased) ### Import and Sync * FIX: sync lower-cased all object names since v1.10 (#2608) +* FIX: sync for Datalist entries has been fixed (#2618) ### UI * FIX: "Modify" Services via the monitoring module (#2615, #2619) diff --git a/library/Director/Import/Sync.php b/library/Director/Import/Sync.php index b7fc0ba0..7523676c 100644 --- a/library/Director/Import/Sync.php +++ b/library/Director/Import/Sync.php @@ -10,6 +10,7 @@ use Icinga\Module\Director\Data\Db\DbObject; use Icinga\Module\Director\Data\Db\DbObjectStore; use Icinga\Module\Director\Data\Db\DbObjectTypeRegistry; use Icinga\Module\Director\Db; +use Icinga\Module\Director\Db\Branch\BranchSupport; use Icinga\Module\Director\Db\Cache\PrefetchCache; use Icinga\Module\Director\Objects\HostGroupMembershipResolver; use Icinga\Module\Director\Objects\IcingaHost; @@ -406,8 +407,9 @@ class Sync if ($this->rule->hasCombinedKey()) { $this->objects = []; $destinationKeyPattern = $this->rule->getDestinationKeyPattern(); - if ($this->store) { - $objects = $this->store->loadAll(DbObjectTypeRegistry::tableNameByType($ruleObjectType)); + $table = DbObjectTypeRegistry::tableNameByType($ruleObjectType); + if ($this->store && BranchSupport::existsForTableName($table)) { + $objects = $this->store->loadAll($table); } else { $objects = IcingaObject::loadAllByType($ruleObjectType, $this->db); }