mirror of
https://github.com/werkraum-media/thuecat.git
synced 2024-12-04 19:16:13 +01:00
parent
fd9507b525
commit
bfa67d3514
3 changed files with 21 additions and 15 deletions
|
@ -363,6 +363,7 @@ class GeneralConverter implements Converter, LoggerAwareInterface
|
||||||
string $language
|
string $language
|
||||||
): string {
|
): string {
|
||||||
$data = [];
|
$data = [];
|
||||||
|
$idMainImage = '';
|
||||||
|
|
||||||
if ($entity->getPhoto() instanceof ForeignReference) {
|
if ($entity->getPhoto() instanceof ForeignReference) {
|
||||||
$photo = $this->resolveForeignReference->resolve(
|
$photo = $this->resolveForeignReference->resolve(
|
||||||
|
@ -370,6 +371,7 @@ class GeneralConverter implements Converter, LoggerAwareInterface
|
||||||
$language
|
$language
|
||||||
);
|
);
|
||||||
if ($photo instanceof MediaObject) {
|
if ($photo instanceof MediaObject) {
|
||||||
|
$idMainImage = $photo->getId();
|
||||||
$data[] = $this->getSingleMedia($photo, true, $language);
|
$data[] = $this->getSingleMedia($photo, true, $language);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -379,7 +381,9 @@ class GeneralConverter implements Converter, LoggerAwareInterface
|
||||||
$image,
|
$image,
|
||||||
$language
|
$language
|
||||||
);
|
);
|
||||||
if ($image instanceof MediaObject) {
|
// Do not import main image again as image.
|
||||||
|
// It is very likely that the same resource is provided as photo and image.
|
||||||
|
if ($image instanceof MediaObject && $image->getId() !== $idMainImage) {
|
||||||
$data[] = $this->getSingleMedia($image, false, $language);
|
$data[] = $this->getSingleMedia($image, false, $language);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,8 @@ Features
|
||||||
|
|
||||||
* Media has a new method ``getExtraImages()`` which will return everything from
|
* Media has a new method ``getExtraImages()`` which will return everything from
|
||||||
``getImages()`` except the ``getMainImage()``.
|
``getImages()`` except the ``getMainImage()``.
|
||||||
|
We now also filter out the main image from other images, it will not exist twice
|
||||||
|
anymore.
|
||||||
|
|
||||||
Fixes
|
Fixes
|
||||||
-----
|
-----
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue