diff --git a/src/DataObject/GridColumnConfig/Operator/VersionGetter.php b/src/DataObject/GridColumnConfig/Operator/VersionGetter.php index 6cf41c63b..a39f4a1c7 100644 --- a/src/DataObject/GridColumnConfig/Operator/VersionGetter.php +++ b/src/DataObject/GridColumnConfig/Operator/VersionGetter.php @@ -39,38 +39,38 @@ public function getLabeledValue(array|ElementInterface $element): ResultContaine if (!$children) { return $result; - } else { - $c = $children[0]; + } - $valueArray = []; + $c = $children[0]; - $latestVersion = $element->getLatestVersion(null, false); - if($latestVersion){ - $element = $latestVersion->loadData(); - } + $valueArray = []; - $childResult = $c->getLabeledValue($element); - $isArrayType = $childResult->isArrayType ?? null; - $childValues = $childResult->value; - if ($childValues && !$isArrayType) { - $childValues = [$childValues]; - } + $latestVersion = $element->getLatestVersion(null, false); + if($latestVersion){ + $element = $latestVersion->loadData(); + } - if ($childValues) { - /** @var string $childValue */ - foreach ($childValues as $childValue) { - $valueArray[] = $childValue; - } - } + $childResult = $c->getLabeledValue($element); + $isArrayType = $childResult->isArrayType ?? null; + $childValues = $childResult->value; + if ($childValues && !$isArrayType) { + $childValues = [$childValues]; + } - $result->isArrayType = $isArrayType; - if ($isArrayType) { - $result->value = $valueArray; - } else { - $result->value = $valueArray[0] ?? null; + if ($childValues) { + /** @var string $childValue */ + foreach ($childValues as $childValue) { + $valueArray[] = $childValue; } } + $result->isArrayType = $isArrayType; + if ($isArrayType) { + $result->value = $valueArray; + } else { + $result->value = $valueArray[0] ?? null; + } + return $result; } }