From 1d08c954baeaf4d2fd34d52e1d03d65c7910444d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 9 Aug 2023 14:10:37 +0200 Subject: [PATCH] IcingaDbState: Fix postgres support -.- --- library/Businessprocess/State/IcingaDbState.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/Businessprocess/State/IcingaDbState.php b/library/Businessprocess/State/IcingaDbState.php index d44c0f5..1a66900 100644 --- a/library/Businessprocess/State/IcingaDbState.php +++ b/library/Businessprocess/State/IcingaDbState.php @@ -92,7 +92,7 @@ class IcingaDbState $serviceIds = []; $serviceResults = []; foreach ($this->backend->yieldAll($services->assembleSelect()) as $row) { - $row->hex_id = bin2hex($row->id); + $row->hex_id = bin2hex(is_resource($row->id) ? stream_get_contents($row->id) : $row->id); $serviceIds[] = $row->hex_id; $serviceResults[] = $row; } @@ -120,7 +120,7 @@ class IcingaDbState $hostIds = []; $hostResults = []; foreach ($this->backend->yieldAll($hosts->assembleSelect()) as $row) { - $row->hex_id = bin2hex($row->id); + $row->hex_id = bin2hex(is_resource($row->id) ? stream_get_contents($row->id) : $row->id); $hostIds[] = $row->hex_id; $hostResults[] = $row; }