|
22 | 22 | use Magento\Eav\Model\Entity\Type;
|
23 | 23 | use Magento\Framework\App\ObjectManager;
|
24 | 24 | use Magento\Framework\App\RequestInterface;
|
| 25 | +use Magento\Framework\AuthorizationInterface; |
25 | 26 | use Magento\Framework\Config\DataInterfaceFactory;
|
26 | 27 | use Magento\Framework\Exception\LocalizedException;
|
27 | 28 | use Magento\Framework\Exception\NoSuchEntityException;
|
|
33 | 34 | use Magento\Ui\Component\Form\Field;
|
34 | 35 | use Magento\Ui\DataProvider\EavValidationRules;
|
35 | 36 | use Magento\Ui\DataProvider\Modifier\PoolInterface;
|
36 |
| -use Magento\Framework\AuthorizationInterface; |
37 | 37 | use Magento\Ui\DataProvider\ModifierPoolDataProvider;
|
38 | 38 |
|
39 | 39 | /**
|
@@ -671,22 +671,21 @@ protected function getFieldsMap()
|
671 | 671 | continue;
|
672 | 672 | }
|
673 | 673 |
|
674 |
| - $fieldsMap[$group] = []; |
| 674 | + $fields = []; |
675 | 675 |
|
676 | 676 | foreach ($node['children'] as $childName => $childNode) {
|
677 | 677 | if (!empty($childNode['children'])) {
|
678 | 678 | // <container/> nodes need special handling
|
679 |
| - foreach ($childNode['children'] as $grandchildName => $grandchildNode) { |
680 |
| - $fieldsMap[$group][] = $grandchildName; |
| 679 | + foreach (array_keys($childNode['children']) as $grandchildName) { |
| 680 | + $fields[] = $grandchildName; |
681 | 681 | }
|
682 | 682 | } else {
|
683 |
| - $fieldsMap[$group][] = $childName; |
| 683 | + $fields[] = $childName; |
684 | 684 | }
|
685 | 685 | }
|
686 | 686 |
|
687 |
| - // Remove empty groups |
688 |
| - if (empty($fieldsMap[$group])) { |
689 |
| - unset($fieldsMap[$group]); |
| 687 | + if (count($fields)) { |
| 688 | + $fieldsMap[$group] = $fields; |
690 | 689 | }
|
691 | 690 | }
|
692 | 691 |
|
|
0 commit comments