From a7afaf71f235197d40f60cf41ad9ec0e56dbaa79 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Tue, 27 May 2025 14:39:49 +0200 Subject: [PATCH] IcingaApiCommandRenderer: Don't set empty array, if no attr is set - Use the returned value instead, either array or null. - With https://github.com/Icinga/icinga2/issues/8167 attrs=[] means that no attrs are fetched at all, and attrs=null means that all available attrs are fetched --- library/Icingadb/Command/Renderer/IcingaApiCommandRenderer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icingadb/Command/Renderer/IcingaApiCommandRenderer.php b/library/Icingadb/Command/Renderer/IcingaApiCommandRenderer.php index c7d221ba..6983b397 100644 --- a/library/Icingadb/Command/Renderer/IcingaApiCommandRenderer.php +++ b/library/Icingadb/Command/Renderer/IcingaApiCommandRenderer.php @@ -127,7 +127,7 @@ class IcingaApiCommandRenderer implements IcingaCommandRendererInterface { $data = [ 'all_joins' => 1, - 'attrs' => $command->getAttributes() ?: [] + 'attrs' => $command->getAttributes() ]; $endpoint = 'objects/' . $this->getObjectPluralType($this->applyFilter($data, $command->getObjects()));