From 20077260b9e68e31e2ed4494d45b0f530d923dc1 Mon Sep 17 00:00:00 2001 From: Beatrycze Volk Date: Fri, 20 Sep 2024 17:33:39 +0200 Subject: [PATCH] [BUGFIX] Change metadata to keep arrays instead of strings (#1339) Co-authored-by: Sebastian Meyer --- Classes/Controller/MetadataController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Classes/Controller/MetadataController.php b/Classes/Controller/MetadataController.php index 142385b15..9d43158b9 100644 --- a/Classes/Controller/MetadataController.php +++ b/Classes/Controller/MetadataController.php @@ -161,9 +161,11 @@ protected function printMetadata(array $metadata): void ); foreach ($metadata as $i => $section) { - foreach ($section as $name => $value) { // NOTE: Labels are to be escaped in Fluid template + $metadata[$i][$name] = is_array($value) + ? $value + : explode($this->settings['separator'], $value); $this->parseMetadata($i, $name, $value, $metadata); @@ -420,9 +422,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(); } }