File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
app/code/Magento/Ui/Component/Form/Element Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 9
9
use Magento \Framework \View \Element \UiComponent \ContextInterface ;
10
10
11
11
/**
12
+ * Base abstract form element.
13
+ *
14
+ * phpcs:disable Magento2.Classes.AbstractApi
12
15
* @api
13
16
* @since 100.1.0
14
17
*/
@@ -59,7 +62,7 @@ public function prepare()
59
62
if (empty ($ config ['rawOptions ' ])) {
60
63
$ options = $ this ->convertOptionsValueToString ($ options );
61
64
}
62
- $ config ['options ' ] = array_values (array_merge_recursive ($ config ['options ' ], $ options ));
65
+ $ config ['options ' ] = array_values (array_replace_recursive ($ config ['options ' ], $ options ));
63
66
}
64
67
$ this ->setData ('config ' , (array )$ config );
65
68
parent ::prepare ();
@@ -84,11 +87,14 @@ abstract public function getIsSelected($optionValue);
84
87
*/
85
88
protected function convertOptionsValueToString (array $ options )
86
89
{
87
- array_walk ($ options , function (&$ value ) {
88
- if (isset ($ value ['value ' ]) && is_scalar ($ value ['value ' ])) {
89
- $ value ['value ' ] = (string )$ value ['value ' ];
90
+ array_walk (
91
+ $ options ,
92
+ static function (&$ value ) {
93
+ if (isset ($ value ['value ' ]) && is_scalar ($ value ['value ' ])) {
94
+ $ value ['value ' ] = (string )$ value ['value ' ];
95
+ }
90
96
}
91
- } );
97
+ );
92
98
return $ options ;
93
99
}
94
100
}
You can’t perform that action at this time.
0 commit comments