File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 66namespace Magento \Captcha \Cron ;
77
88use 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
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments