From 139b52079f763b30a8fb0c28f0d57b6eeeddad1c Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 28 Oct 2015 22:31:37 +0100 Subject: [PATCH] Import: allow for simple objects (hashes, dicts) --- library/Director/Import/Import.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/Director/Import/Import.php b/library/Director/Import/Import.php index 573b426e..d8007ad8 100644 --- a/library/Director/Import/Import.php +++ b/library/Director/Import/Import.php @@ -6,6 +6,7 @@ use Icinga\Module\Director\Objects\ImportSource; use Icinga\Module\Director\Util; use Icinga\Module\Director\Web\Hook\ImportSourceHook; use Icinga\Exception\IcingaException; +use stdClass; class Import { @@ -59,6 +60,9 @@ class Import if (is_array($pval)) { $pval = json_encode($pval); $format = 'json'; + } elseif ($pval instanceof stdClass) { + $pval = json_encode($pval); + $format = 'json'; } else { $format = 'string'; }