Skip to content

Commit 70b0d06

Browse files
author
Viktor Kopin
committed
adobe-stock-integration#1792: fix category image is not removed from tmp folder after category save
1 parent 5d8908c commit 70b0d06

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/code/Magento/MediaGalleryCatalogIntegration/Plugin/SaveBaseCategoryImageInformation.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,18 @@ public function __construct(
8181
*
8282
* @param ImageUploader $subject
8383
* @param string $imagePath
84+
* @param string $initialImageName
8485
* @return string
8586
* @throws LocalizedException
8687
*/
87-
public function afterMoveFileFromTmp(ImageUploader $subject, string $imagePath): string
88+
public function afterMoveFileFromTmp(ImageUploader $subject, string $imagePath, string $initialImageName): string
8889
{
8990
if (!$this->config->isEnabled()) {
9091
return $imagePath;
9192
}
9293

9394
$absolutePath = $this->storage->getCmsWysiwygImages()->getStorageRoot() . $imagePath;
94-
$tmpPath = $subject->getBaseTmpPath() . '/' . substr(strrchr($imagePath, '/'), 1);
95+
$tmpPath = $subject->getBaseTmpPath() . '/' . $initialImageName;
9596
$tmpAssets = $this->getAssetsByPaths->execute([$tmpPath]);
9697

9798
if (!empty($tmpAssets)) {

0 commit comments

Comments
 (0)