Fixed loading media index

This commit is contained in:
Matias Griese
2022-04-05 20:08:39 +03:00
parent c992721530
commit 5e9033ef8a
2 changed files with 2 additions and 2 deletions

View File

@@ -378,7 +378,7 @@ abstract class AbstractMedia implements ExportInterface, MediaCollectionInterfac
$mediaIndex->lock();
$id = $this->getId();
$index = $mediaIndex->get($id, true);
[$index,] = $mediaIndex->get($id, true);
if ($files === null) {
$files = $index['files'] ?? [];

View File

@@ -935,7 +935,7 @@ class FlexObject implements FlexObjectInterface, FlexAuthorizeInterface
$media = $this->getMediaField($name);
if ($media && !$media instanceof LocalMedia) {
$value = [];
foreach ($media->all() as $filename => $medium) {
foreach ($media->all() as $medium) {
$value[] = $medium->meta;
}
}