File tree Expand file tree Collapse file tree 5 files changed +250
-135
lines changed
Test/Unit/Block/System/Config
lib/internal/Magento/Framework/App Expand file tree Collapse file tree 5 files changed +250
-135
lines changed Original file line number Diff line number Diff line change 3
3
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+
6
7
namespace Magento \Config \App \Config \Source ;
7
8
8
9
use Magento \Framework \App \Config \ConfigSourceInterface ;
@@ -84,12 +85,12 @@ private function loadConfig()
84
85
}
85
86
}
86
87
87
- foreach ($ config as $ scope => & $ item ) {
88
+ foreach ($ config as $ scope => $ item ) {
88
89
if ($ scope === ScopeConfigInterface::SCOPE_TYPE_DEFAULT ) {
89
- $ item = $ this ->converter ->convert ($ item );
90
+ $ config [ $ scope ] = $ this ->converter ->convert ($ item );
90
91
} else {
91
- foreach ($ item as & $ scopeItems ) {
92
- $ scopeItems = $ this ->converter ->convert ($ scopeItems );
92
+ foreach ($ item as $ scopeCode => $ scopeItems ) {
93
+ $ config [ $ scope ][ $ scopeCode ] = $ this ->converter ->convert ($ scopeItems );
93
94
}
94
95
}
95
96
}
Original file line number Diff line number Diff line change 3
3
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
-
7
6
namespace Magento \Config \Block \System \Config ;
8
7
9
8
use Magento \Config \App \Config \Type \System ;
@@ -351,21 +350,21 @@ protected function _initElement(
351
350
$ data = $ this ->_configData [$ path ];
352
351
$ inherit = false ;
353
352
353
+ if ($ field ->hasBackendModel ()) {
354
+ $ backendModel = $ field ->getBackendModel ();
355
+ $ backendModel ->setPath ($ path )
356
+ ->setValue ($ data )
357
+ ->setWebsite ($ this ->getWebsiteCode ())
358
+ ->setStore ($ this ->getStoreCode ())
359
+ ->afterLoad ();
360
+ $ data = $ backendModel ->getValue ();
361
+ }
362
+
354
363
} elseif ($ field ->getConfigPath () !== null ) {
355
364
$ data = $ this ->getConfigValue ($ field ->getConfigPath ());
356
365
} else {
357
366
$ data = $ this ->getConfigValue ($ path );
358
367
}
359
-
360
- if ($ field ->hasBackendModel ()) {
361
- $ backendModel = $ field ->getBackendModel ();
362
- $ backendModel ->setPath ($ path )
363
- ->setValue ($ data )
364
- ->setWebsite ($ this ->getWebsiteCode ())
365
- ->setStore ($ this ->getStoreCode ())
366
- ->afterLoad ();
367
- $ data = $ backendModel ->getValue ();
368
- }
369
368
}
370
369
$ fieldRendererClass = $ field ->getFrontendModel ();
371
370
if ($ fieldRendererClass ) {
You can’t perform that action at this time.
0 commit comments