From 008f8ef03b5eb4b8345bd1657d588bd7cb435e5a Mon Sep 17 00:00:00 2001 From: Szymon Dudzik Date: Thu, 28 Mar 2019 22:09:05 +0100 Subject: [PATCH 1/2] Fixes issue with non existing file, when adding image to gallery with move option. Fix for #21978 --- app/code/Magento/Catalog/Model/Product/Gallery/Processor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Product/Gallery/Processor.php b/app/code/Magento/Catalog/Model/Product/Gallery/Processor.php index bf7bfbe681929..597b201381228 100644 --- a/app/code/Magento/Catalog/Model/Product/Gallery/Processor.php +++ b/app/code/Magento/Catalog/Model/Product/Gallery/Processor.php @@ -191,7 +191,7 @@ public function addImage( $mediaGalleryData = $product->getData($attrCode); $position = 0; - $absoluteFilePath = $this->mediaDirectory->getAbsolutePath($file); + $absoluteFilePath = $this->mediaDirectory->getAbsolutePath($destinationFile); $imageMimeType = $this->mime->getMimeType($absoluteFilePath); $imageContent = $this->mediaDirectory->readFile($absoluteFilePath); $imageBase64 = base64_encode($imageContent); From e97f14c8e59f201a6fe8df7ed5326cfb130d0300 Mon Sep 17 00:00:00 2001 From: Nazarn96 Date: Tue, 30 Apr 2019 10:16:10 +0300 Subject: [PATCH 2/2] magento/magento2#22020 static-test-fix --- app/code/Magento/Catalog/Model/Product/Gallery/Processor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Product/Gallery/Processor.php b/app/code/Magento/Catalog/Model/Product/Gallery/Processor.php index 597b201381228..830c1926cc483 100644 --- a/app/code/Magento/Catalog/Model/Product/Gallery/Processor.php +++ b/app/code/Magento/Catalog/Model/Product/Gallery/Processor.php @@ -489,7 +489,7 @@ protected function getNotDuplicatedFilename($fileName, $dispretionPath) /** * Retrieve data for update attribute * - * @param \Magento\Catalog\Model\Product $object + * @param \Magento\Catalog\Model\Product $object * @return array * @since 101.0.0 */