From 008f8ef03b5eb4b8345bd1657d588bd7cb435e5a Mon Sep 17 00:00:00 2001 From: Szymon Dudzik Date: Thu, 28 Mar 2019 22:09:05 +0100 Subject: [PATCH] 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);