Skip to content

Commit fd66204

Browse files
committed
Fixed ability to set field config from layout xml
Example: ``` <item name="postcode" xsi:type="array"> <item name="config" xsi:type="array"> <item name="label" xsi:type="string">Another Label</item> <item name="placeholder" xsi:type="string">Field Placeholder</item> </item> ... </item> ```
1 parent 6e49308 commit fd66204

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -168,20 +168,18 @@ protected function getFieldConfig(
168168

169169
$element = [
170170
'component' => isset($additionalConfig['component']) ? $additionalConfig['component'] : $uiComponent,
171-
'config' => [
172-
// customScope is used to group elements within a single form (e.g. they can be validated separately)
173-
'customScope' => $dataScopePrefix,
174-
'customEntry' => isset($additionalConfig['config']['customEntry'])
175-
? $additionalConfig['config']['customEntry']
176-
: null,
177-
'template' => 'ui/form/field',
178-
'elementTmpl' => isset($additionalConfig['config']['elementTmpl'])
179-
? $additionalConfig['config']['elementTmpl']
180-
: $elementTemplate,
181-
'tooltip' => isset($additionalConfig['config']['tooltip'])
182-
? $additionalConfig['config']['tooltip']
183-
: null
184-
],
171+
'config' => $this->mergeConfigurationNode(
172+
'config',
173+
$additionalConfig,
174+
[
175+
'config' => [
176+
// customScope is used to group elements within a single form (e.g. they can be validated separately)
177+
'customScope' => $dataScopePrefix,
178+
'template' => 'ui/form/field',
179+
'elementTmpl' => $elementTemplate,
180+
],
181+
]
182+
),
185183
'dataScope' => $dataScopePrefix . '.' . $attributeCode,
186184
'label' => $attributeConfig['label'],
187185
'provider' => $providerName,

0 commit comments

Comments
 (0)