File tree Expand file tree Collapse file tree 4 files changed +17
-13
lines changed
Test/Unit/Block/System/Config
dev/tests/integration/testsuite/Magento/Config/Block/System/Config/_files Expand file tree Collapse file tree 4 files changed +17
-13
lines changed Original file line number Diff line number Diff line change 8
8
use Magento \Config \App \Config \Type \System ;
9
9
use Magento \Config \Model \Config \Reader \Source \Deployed \SettingChecker ;
10
10
use Magento \Config \Model \Config \Structure \ElementVisibilityInterface ;
11
+ use Magento \Framework \App \Config \Data \ProcessorInterface ;
11
12
use Magento \Framework \App \Config \ScopeConfigInterface ;
12
13
use Magento \Framework \App \DeploymentConfig ;
13
14
use Magento \Framework \App \ObjectManager ;
@@ -429,6 +430,18 @@ private function getFieldData(\Magento\Config\Model\Config\Structure\Element\Fie
429
430
if ($ data === null ) {
430
431
$ path = $ field ->getConfigPath () !== null ? $ field ->getConfigPath () : $ path ;
431
432
$ data = $ this ->getConfigValue ($ path );
433
+ if ($ field ->hasBackendModel ()) {
434
+ $ backendModel = $ field ->getBackendModel ();
435
+ // Backend models which implement ProcessorInterface are processed by ScopeConfigInterface
436
+ if (!$ backendModel instanceof ProcessorInterface) {
437
+ $ backendModel ->setPath ($ path )
438
+ ->setValue ($ data )
439
+ ->setWebsite ($ this ->getWebsiteCode ())
440
+ ->setStore ($ this ->getStoreCode ())
441
+ ->afterLoad ();
442
+ $ data = $ backendModel ->getValue ();
443
+ }
444
+ }
432
445
}
433
446
434
447
return $ data ;
Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Config \Model \Config \Backend ;
7
7
8
- use Magento \Framework \App \Config \Data \ProcessorInterface ;
9
8
use Magento \Framework \App \ObjectManager ;
10
9
use Magento \Framework \Serialize \Serializer \Json ;
11
10
12
11
/**
13
12
* @api
14
13
* @since 100.0.2
15
14
*/
16
- class Serialized extends \Magento \Framework \App \Config \Value implements ProcessorInterface
15
+ class Serialized extends \Magento \Framework \App \Config \Value
17
16
{
18
17
/**
19
18
* @var Json
@@ -68,12 +67,4 @@ public function beforeSave()
68
67
parent ::beforeSave ();
69
68
return $ this ;
70
69
}
71
-
72
- /**
73
- * @inheritdoc
74
- */
75
- public function processValue ($ value )
76
- {
77
- return empty ($ value ) ? '' : $ this ->serializer ->unserialize ($ value );
78
- }
79
70
}
Original file line number Diff line number Diff line change @@ -548,7 +548,7 @@ public function initFieldsDataProvider()
548
548
false ,
549
549
'some_value ' ,
550
550
null ,
551
- 0 ,
551
+ 1 ,
552
552
false ,
553
553
false ,
554
554
false
@@ -560,7 +560,7 @@ public function initFieldsDataProvider()
560
560
true ,
561
561
'Config Value ' ,
562
562
null ,
563
- 0 ,
563
+ 1 ,
564
564
true ,
565
565
false ,
566
566
true
Original file line number Diff line number Diff line change 10
10
<test_section >
11
11
<test_group >
12
12
<test_field_encrypted backend_model =" Magento\Config\Model\Config\Backend\Encrypted" >{ENCRYPTED_VALUE}</test_field_encrypted >
13
- <test_field_serialized backend_model = " Magento\Config\Model\Config\Backend\Serialized " >["value1","value2"]</test_field_serialized >
13
+ <test_field_serialized >["value1","value2"]</test_field_serialized >
14
14
<test_field >test config value</test_field >
15
15
</test_group >
16
16
</test_section >
You can’t perform that action at this time.
0 commit comments