diff --git a/vendor/magento/module-catalog/Model/Product/Gallery/ReadHandler.php b/vendor/magento/module-catalog/Model/Product/Gallery/ReadHandler.php index ed2e09249e495..9005cbe4249bb 100644 --- a/vendor/magento/module-catalog/Model/Product/Gallery/ReadHandler.php +++ b/vendor/magento/module-catalog/Model/Product/Gallery/ReadHandler.php @@ -64,7 +64,7 @@ public function execute($entity, $arguments = []) $this->addMediaDataToProduct( $entity, - $this->sortMediaEntriesByPosition($mediaEntries) + $mediaEntries ); return $entity; @@ -80,6 +80,7 @@ public function execute($entity, $arguments = []) */ public function addMediaDataToProduct(Product $product, array $mediaEntries) { + $mediaEntries = $this->sortMediaEntriesByPosition($mediaEntries); $product->setData( $this->getAttribute()->getAttributeCode(), [ @@ -111,6 +112,7 @@ public function getAttribute() * @param string[] $image * @return string * @deprecated 101.0.1 + * @see \Magento\Catalog\Model\Product\Gallery\ReadHandler::addMediaDataToProduct * @since 101.0.0 */ protected function findDefaultValue($key, &$image)