Skip to content

Commit

Permalink
[BUGFIX] Change metadata to keep arrays instead of strings (#1339)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Meyer <[email protected]>
  • Loading branch information
beatrycze-volk and sebastian-meyer committed Sep 20, 2024
1 parent 0377a5e commit 2007726
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Classes/Controller/MetadataController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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();
}
}

Expand Down

0 comments on commit 2007726

Please sign in to comment.