Skip to content

Commit 59c6176

Browse files
authored
Merge pull request #6461 from magento-performance/MC-39959
MC-39959: [AWS S3] Bug fixes
2 parents 7ea49be + 0ce6cd7 commit 59c6176

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

app/code/Magento/Captcha/Cron/DeleteExpiredImages.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Captcha\Cron;
77

88
use Magento\Framework\App\Filesystem\DirectoryList;
9+
use Magento\Framework\Filesystem\DriverPool;
910

1011
/**
1112
* Captcha cron actions
@@ -48,7 +49,7 @@ public function __construct(
4849
) {
4950
$this->_helper = $helper;
5051
$this->_adminHelper = $adminHelper;
51-
$this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
52+
$this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA, DriverPool::FILE);
5253
$this->_storeManager = $storeManager;
5354
}
5455

app/code/Magento/Catalog/Model/Config/CatalogMediaConfig.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class CatalogMediaConfig
1616
{
1717
private const XML_PATH_CATALOG_MEDIA_URL_FORMAT = 'web/url/catalog_media_url_format';
1818

19-
const IMAGE_OPTIMIZATION_PARAMETERS = 'image_optimization_parameters';
20-
const HASH = 'hash';
19+
public const IMAGE_OPTIMIZATION_PARAMETERS = 'image_optimization_parameters';
20+
public const HASH = 'hash';
2121

2222
/**
2323
* @var ScopeConfigInterface
@@ -41,10 +41,16 @@ public function __construct(ScopeConfigInterface $scopeConfig)
4141
*/
4242
public function getMediaUrlFormat($scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode = null): string
4343
{
44-
return $this->scopeConfig->getValue(
45-
CatalogMediaConfig::XML_PATH_CATALOG_MEDIA_URL_FORMAT,
44+
$value = $this->scopeConfig->getValue(
45+
self::XML_PATH_CATALOG_MEDIA_URL_FORMAT,
4646
$scopeType,
4747
$scopeCode
4848
);
49+
50+
if ($value === null) {
51+
return self::HASH;
52+
}
53+
54+
return (string)$value;
4955
}
5056
}

0 commit comments

Comments
 (0)