From 90b5f6fdac06306bb643bae522b3d1362418ee2d Mon Sep 17 00:00:00 2001 From: Ravi Kumar Kempapura Srinivasa Date: Thu, 30 Sep 2021 15:25:45 +0200 Subject: [PATCH] Convert $imports keys to string explicitly The keys of $imports in IcingaObjectImports must be converted to string explicitly or else it establishes incorrect parent-child relation in icinga_host_inheritance table in case the key is integer value and there is an host object with id = key(integer) icinga_host table. This results in undefined offset while triggering sync rule. --- library/Director/Objects/IcingaObjectImports.php | 1 + 1 file changed, 1 insertion(+) diff --git a/library/Director/Objects/IcingaObjectImports.php b/library/Director/Objects/IcingaObjectImports.php index 109ec0c8..6591a2fb 100644 --- a/library/Director/Objects/IcingaObjectImports.php +++ b/library/Director/Objects/IcingaObjectImports.php @@ -232,6 +232,7 @@ class IcingaObjectImports implements Iterator, Countable, IcingaConfigRenderer { $list = []; foreach ($this->listImportNames() as $name) { + $name = (string) $name; $list[$name] = $this->getObject($name); }