Skip to content

Commit 9707339

Browse files
committed
B2B-1789: First Request For Storefront Image After Deleting Local File System Cached Images Results In Magento Placeholder Image When Using S3 -
Changed plugin to around type
1 parent 421d828 commit 9707339

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/code/Magento/RemoteStorage/Plugin/File/Storage/SynchronizationFactory.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace Magento\RemoteStorage\Plugin\File\Storage;
99

1010
use Magento\RemoteStorage\Model\File\Storage\Synchronization;
11-
use Magento\MediaStorage\Model\File\Storage\SynchronizationFactory as mediaSynchronizationFactory;
11+
use Magento\MediaStorage\Model\File\Storage\SynchronizationFactory as MediaSynchronizationFactory;
1212
use Magento\RemoteStorage\Model\Config;
1313
use Magento\Framework\ObjectManagerInterface;
1414

@@ -44,17 +44,20 @@ public function __construct(ObjectManagerInterface $objectManager, Config $confi
4444
/**
4545
* Create remote synchronization instance
4646
*
47-
* @param mediaSynchronizationFactory $subject
47+
* @param MediaSynchronizationFactory $subject
48+
* @param callable $proceed
4849
* @param array $data
4950
* @return mixed
5051
* @throws \Magento\Framework\Exception\FileSystemException
5152
* @throws \Magento\Framework\Exception\RuntimeException
5253
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
5354
*/
54-
public function beforeCreate(mediaSynchronizationFactory $subject, array $data = [])
55+
public function aroundCreate(MediaSynchronizationFactory $subject, callable $proceed, array $data = [])
5556
{
57+
$result = $proceed($data);
5658
if ($this->config->isEnabled()) {
5759
return $this->objectManager->create(Synchronization::class, $data);
5860
}
61+
return $result;
5962
}
6063
}

0 commit comments

Comments
 (0)