File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
lib/internal/Magento/Framework/App/Config Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Framework \App \Config ;
7
7
8
+ use Magento \Framework \App \ScopeInterface ;
8
9
use Magento \Framework \App \ScopeResolverPool ;
9
10
10
11
/**
@@ -34,28 +35,32 @@ public function __construct(ScopeResolverPool $scopeResolverPool)
34
35
* Resolve scope code
35
36
*
36
37
* @param string $scopeType
37
- * @param string $scopeCode
38
+ * @param string|null $scopeCode
38
39
* @return string
39
40
*/
40
41
public function resolve ($ scopeType , $ scopeCode )
41
42
{
42
43
if (isset ($ this ->resolvedScopeCodes [$ scopeType ][$ scopeCode ])) {
43
44
return $ this ->resolvedScopeCodes [$ scopeType ][$ scopeCode ];
44
45
}
45
- if (($ scopeCode === null || is_numeric ($ scopeCode ))
46
- && $ scopeType !== ScopeConfigInterface::SCOPE_TYPE_DEFAULT
47
- ) {
46
+
47
+ if ($ scopeType !== ScopeConfigInterface::SCOPE_TYPE_DEFAULT ) {
48
48
$ scopeResolver = $ this ->scopeResolverPool ->get ($ scopeType );
49
49
$ resolverScopeCode = $ scopeResolver ->getScope ($ scopeCode );
50
50
} else {
51
51
$ resolverScopeCode = $ scopeCode ;
52
52
}
53
53
54
- if ($ resolverScopeCode instanceof \ Magento \ Framework \ App \ ScopeInterface) {
54
+ if ($ resolverScopeCode instanceof ScopeInterface) {
55
55
$ resolverScopeCode = $ resolverScopeCode ->getCode ();
56
56
}
57
57
58
+ if ($ scopeCode === null ) {
59
+ $ scopeCode = $ resolverScopeCode ;
60
+ }
61
+
58
62
$ this ->resolvedScopeCodes [$ scopeType ][$ scopeCode ] = $ resolverScopeCode ;
63
+
59
64
return $ resolverScopeCode ;
60
65
}
61
66
You can’t perform that action at this time.
0 commit comments