Skip to content

Commit 59087ba

Browse files
committed
B2B-2067: Gallery Image is not saving the remote storage file on to local
- Added static fix 2
1 parent 3807ee1 commit 59087ba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/code/Magento/RemoteStorage/Plugin/GalleryImageCopy.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,25 @@ public function __construct(
6060
*
6161
* @param Gallery $subject
6262
* @param callable $proceed
63-
* @return string
63+
* @return string|null
6464
* @throws FileSystemException
6565
* @throws \Magento\Framework\Exception\RuntimeException
6666
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
6767
*/
6868
public function aroundGetImageWidth(Gallery $subject, callable $proceed): string
6969
{
70-
return $this->copyFileToTmp($subject,$proceed);
70+
return $this->copyFileToTmp($subject, $proceed);
7171
}
7272

7373
/**
7474
* Move files from storage to tmp folder
7575
*
7676
* @param Gallery $subject
7777
* @param callable $proceed
78-
* @return string
78+
* @return string|null
7979
* @throws FileSystemException
8080
* @throws \Magento\Framework\Exception\RuntimeException
81+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
8182
*/
8283
private function copyFileToTmp(Gallery $subject, callable $proceed): string
8384
{
@@ -91,11 +92,10 @@ private function copyFileToTmp(Gallery $subject, callable $proceed): string
9192
$this->tmpDirectoryWrite->create();
9293
$tmpPath = $this->storeTmpName($filePath);
9394
$content = $this->remoteDirectoryWrite->getDriver()->fileGetContents($filePath);
94-
$filePath = $this->tmpDirectoryWrite->getDriver()->filePutContents($tmpPath, $content)
95+
return $this->tmpDirectoryWrite->getDriver()->filePutContents($tmpPath, $content)
9596
? $tmpPath
9697
: $filePath;
9798
}
98-
return $filePath;
9999
}
100100
}
101101

0 commit comments

Comments
 (0)