diff --git a/Classes/Controller/MetadataController.php b/Classes/Controller/MetadataController.php index a8b45f152..b98b75903 100644 --- a/Classes/Controller/MetadataController.php +++ b/Classes/Controller/MetadataController.php @@ -166,15 +166,17 @@ protected function printMetadata(array $metadata): void // NOTE: Labels are to be escaped in Fluid template $metadata[$i][$name] = is_array($value) - ? implode($this->settings['separator'], $value) - : $value; + ? $value + : explode($this->settings['separator'], $value); - if ($metadata[$i][$name] === 'Array') { + // PHPStan error + // I don't understand what this code does, so I take it away until author can fix it + /*if ($metadata[$i][$name][0] === 'Array') { $metadata[$i][$name] = []; foreach ($value as $subKey => $subValue) { $metadata[$i][$name][$subKey] = $subValue; } - } + }*/ $this->parseMetadata($i, $name, $value, $metadata); @@ -431,9 +433,9 @@ private function parseOwner(int $i, array &$metadata) : void */ private function parseType(int $i, array &$metadata) : void { - $structure = $this->structureRepository->findOneByIndexName($metadata[$i]['type']); + $structure = $this->structureRepository->findOneByIndexName($metadata[$i]['type'][0]); if ($structure) { - $metadata[$i]['type'] = $structure->getLabel(); + $metadata[$i]['type'][0] = $structure->getLabel(); } }