From 5a2ada6c16dd055f70437336675c5652f46bfa22 Mon Sep 17 00:00:00 2001 From: ctippler Date: Wed, 21 Dec 2022 11:11:53 +0100 Subject: [PATCH] Concatenator bugfixes #71 --- src/ConfigElement/Operator/Concatenator.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ConfigElement/Operator/Concatenator.php b/src/ConfigElement/Operator/Concatenator.php index b4003c4..20eb81e 100644 --- a/src/ConfigElement/Operator/Concatenator.php +++ b/src/ConfigElement/Operator/Concatenator.php @@ -32,6 +32,7 @@ public function __construct($config, $context = null) public function getLabeledValue($object) { $result = new \stdClass(); + $result->value = null; $result->label = $this->label; $hasValue = true; @@ -46,8 +47,10 @@ public function getLabeledValue($object) $value = $c->getLabeledValue($object) ? $c->getLabeledValue($object)->value : null; if (!$hasValue) { - if (!empty($value) || ((method_exists($value, 'isEmpty') && !$value->isEmpty()))) { - $hasValue = true; + if (is_object($value) && method_exists($value, 'isEmpty')) { + $hasValue = !$value->isEmpty(); + } else { + $hasValue = !empty($value); } }