kitodo / kitodo-presentation

Kitodo.Presentation is a feature-rich framework for building a METS- or IIIF-based digital library. It is part of the Kitodo Digital Library Suite.
https://kitodo.org
GNU General Public License v3.0
38 stars 45 forks source link

[BUG] Reading of collections from database doesn't work #1317

Closed beatrycze-volk closed 1 week ago

beatrycze-volk commented 1 month ago

Description

Reading of collections from database doesn't work in MetadataController.

Expected Behavior

The collections should be read correctly from database and displayed to the frontend.

Screenshots and Examples

Argument $value is a string not and array.

    private function parseCollections(int $i, $value, array &$metadata) : void
    {
        $j = 0;
        foreach ($value as $entry) {
            $collection = $this->collectionRepository->findOneByIndexName($entry);
            if ($collection) {
                $metadata[$i]['collection'][$j] = $collection->getLabel() ? : '';
                $j++;
            }
        }
    }

Additional Context

Related to #1314 and #1308