Skip to content

Commit

Permalink
adobe-stock-integration#1792: fix category image is not removed from …
Browse files Browse the repository at this point in the history
…tmp folder after category save
  • Loading branch information
Viktor Kopin committed Sep 4, 2020
1 parent 5d8908c commit 70b0d06
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,18 @@ public function __construct(
*
* @param ImageUploader $subject
* @param string $imagePath
* @param string $initialImageName
* @return string
* @throws LocalizedException
*/
public function afterMoveFileFromTmp(ImageUploader $subject, string $imagePath): string
public function afterMoveFileFromTmp(ImageUploader $subject, string $imagePath, string $initialImageName): string
{
if (!$this->config->isEnabled()) {
return $imagePath;
}

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

if (!empty($tmpAssets)) {
Expand Down

0 comments on commit 70b0d06

Please sign in to comment.