|
25 | 25 | use Magento\Framework\Session\SessionManagerInterface;
|
26 | 26 | use Magento\Framework\View\Element\UiComponent\ContextInterface;
|
27 | 27 | use Magento\Framework\View\Element\UiComponent\DataProvider\FilterPool;
|
| 28 | +use Magento\Ui\Component\Form\Element\Multiline; |
28 | 29 | use Magento\Ui\Component\Form\Field;
|
29 | 30 | use Magento\Ui\DataProvider\EavValidationRules;
|
30 | 31 |
|
31 | 32 | /**
|
| 33 | + * Supplies the data for the customer UI component |
| 34 | + * |
32 | 35 | * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
33 | 36 | *
|
34 | 37 | * @api
|
@@ -155,10 +158,11 @@ class DataProvider extends \Magento\Ui\DataProvider\AbstractDataProvider
|
155 | 158 | * @param Config $eavConfig
|
156 | 159 | * @param FilterPool $filterPool
|
157 | 160 | * @param FileProcessorFactory $fileProcessorFactory
|
158 |
| - * @param ContextInterface $context |
159 | 161 | * @param array $meta
|
160 | 162 | * @param array $data
|
| 163 | + * @param ContextInterface $context |
161 | 164 | * @param bool $allowToShowHiddenAttributes
|
| 165 | + * @throws \Magento\Framework\Exception\LocalizedException |
162 | 166 | * @SuppressWarnings(PHPMD.ExcessiveParameterList)
|
163 | 167 | */
|
164 | 168 | public function __construct(
|
@@ -596,8 +600,14 @@ protected function prepareAddressData($addressId, array &$addresses, array $cust
|
596 | 600 | ) {
|
597 | 601 | $addresses[$addressId]['default_shipping'] = $customer['default_shipping'];
|
598 | 602 | }
|
599 |
| - if (isset($addresses[$addressId]['street']) && !is_array($addresses[$addressId]['street'])) { |
600 |
| - $addresses[$addressId]['street'] = explode("\n", $addresses[$addressId]['street']); |
| 603 | + |
| 604 | + foreach ($this->meta['address']['children'] as $attributeName => $attributeMeta) { |
| 605 | + if ($attributeMeta['arguments']['data']['config']['dataType'] === Multiline::NAME |
| 606 | + && isset($addresses[$addressId][$attributeName]) |
| 607 | + && !is_array($addresses[$addressId][$attributeName]) |
| 608 | + ) { |
| 609 | + $addresses[$addressId][$attributeName] = explode("\n", $addresses[$addressId][$attributeName]); |
| 610 | + } |
601 | 611 | }
|
602 | 612 | }
|
603 | 613 |
|
|
0 commit comments