Skip to content

Commit

Permalink
Multiple collections causes the gallery to fail (#193)
Browse files Browse the repository at this point in the history
This fixes #192
  • Loading branch information
niekbr authored Aug 4, 2020
1 parent d868704 commit 8c4407c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Fields/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function resolve($resource, $attribute = null)
$this->value = $resource->getMedia($collectionName)
->map(function (\Spatie\MediaLibrary\MediaCollections\Models\Media $media) {
return array_merge($this->serializeMedia($media), ['__media_urls__' => $this->getConversionUrls($media)]);
});
})->values();

if ($collectionName) {
$this->checkCollectionIsMultiple($resource, $collectionName);
Expand Down

0 comments on commit 8c4407c

Please sign in to comment.