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 6
6
namespace Magento \Captcha \Cron ;
7
7
8
8
use Magento \Framework \App \Filesystem \DirectoryList ;
9
+ use Magento \Framework \Filesystem \DriverPool ;
9
10
10
11
/**
11
12
* Captcha cron actions
@@ -48,7 +49,7 @@ public function __construct(
48
49
) {
49
50
$ this ->_helper = $ helper ;
50
51
$ this ->_adminHelper = $ adminHelper ;
51
- $ this ->_mediaDirectory = $ filesystem ->getDirectoryWrite (DirectoryList::MEDIA );
52
+ $ this ->_mediaDirectory = $ filesystem ->getDirectoryWrite (DirectoryList::MEDIA , DriverPool:: FILE );
52
53
$ this ->_storeManager = $ storeManager ;
53
54
}
54
55
Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ class CatalogMediaConfig
16
16
{
17
17
private const XML_PATH_CATALOG_MEDIA_URL_FORMAT = 'web/url/catalog_media_url_format ' ;
18
18
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 ' ;
21
21
22
22
/**
23
23
* @var ScopeConfigInterface
@@ -41,10 +41,16 @@ public function __construct(ScopeConfigInterface $scopeConfig)
41
41
*/
42
42
public function getMediaUrlFormat ($ scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT , $ scopeCode = null ): string
43
43
{
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 ,
46
46
$ scopeType ,
47
47
$ scopeCode
48
48
);
49
+
50
+ if ($ value === null ) {
51
+ return self ::HASH ;
52
+ }
53
+
54
+ return (string )$ value ;
49
55
}
50
56
}
You can’t perform that action at this time.
0 commit comments