Skip to content

Commit

Permalink
Merge pull request #6461 from magento-performance/MC-39959
Browse files Browse the repository at this point in the history
MC-39959: [AWS S3] Bug fixes
  • Loading branch information
joanhe authored Dec 16, 2020
2 parents 7ea49be + 0ce6cd7 commit 59c6176
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/code/Magento/Captcha/Cron/DeleteExpiredImages.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
namespace Magento\Captcha\Cron;

use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\Filesystem\DriverPool;

/**
* Captcha cron actions
Expand Down Expand Up @@ -48,7 +49,7 @@ public function __construct(
) {
$this->_helper = $helper;
$this->_adminHelper = $adminHelper;
$this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
$this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA, DriverPool::FILE);
$this->_storeManager = $storeManager;
}

Expand Down
14 changes: 10 additions & 4 deletions app/code/Magento/Catalog/Model/Config/CatalogMediaConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class CatalogMediaConfig
{
private const XML_PATH_CATALOG_MEDIA_URL_FORMAT = 'web/url/catalog_media_url_format';

const IMAGE_OPTIMIZATION_PARAMETERS = 'image_optimization_parameters';
const HASH = 'hash';
public const IMAGE_OPTIMIZATION_PARAMETERS = 'image_optimization_parameters';
public const HASH = 'hash';

/**
* @var ScopeConfigInterface
Expand All @@ -41,10 +41,16 @@ public function __construct(ScopeConfigInterface $scopeConfig)
*/
public function getMediaUrlFormat($scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode = null): string
{
return $this->scopeConfig->getValue(
CatalogMediaConfig::XML_PATH_CATALOG_MEDIA_URL_FORMAT,
$value = $this->scopeConfig->getValue(
self::XML_PATH_CATALOG_MEDIA_URL_FORMAT,
$scopeType,
$scopeCode
);

if ($value === null) {
return self::HASH;
}

return (string)$value;
}
}

0 comments on commit 59c6176

Please sign in to comment.