diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml index c49bf084adf16..79b71c2bb26bf 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml @@ -424,7 +424,7 @@ - Magento\Catalog\Block\Adminhtml\Category\AssignProducts + diff --git a/app/code/Magento/GoogleOptimizer/view/adminhtml/ui_component/category_form.xml b/app/code/Magento/GoogleOptimizer/view/adminhtml/ui_component/category_form.xml index 7719d54873a91..11adc860d8931 100644 --- a/app/code/Magento/GoogleOptimizer/view/adminhtml/ui_component/category_form.xml +++ b/app/code/Magento/GoogleOptimizer/view/adminhtml/ui_component/category_form.xml @@ -13,7 +13,7 @@ - Magento\GoogleOptimizer\Block\Adminhtml\Catalog\Category\Edit\Googleoptimizer + diff --git a/app/code/Magento/GoogleOptimizer/view/adminhtml/ui_component/cms_page_form.xml b/app/code/Magento/GoogleOptimizer/view/adminhtml/ui_component/cms_page_form.xml index da6fee3404e43..d09be65f29134 100644 --- a/app/code/Magento/GoogleOptimizer/view/adminhtml/ui_component/cms_page_form.xml +++ b/app/code/Magento/GoogleOptimizer/view/adminhtml/ui_component/cms_page_form.xml @@ -13,7 +13,7 @@ - Magento\GoogleOptimizer\Block\Adminhtml\Form\CmsPage + diff --git a/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml b/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml index 78b4ab3b982b5..02cab73f63896 100644 --- a/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml +++ b/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml @@ -409,7 +409,7 @@ - Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Conditions + @@ -521,7 +521,7 @@ - Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Actions + @@ -544,7 +544,7 @@ - Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Labels + diff --git a/app/code/Magento/Ui/Config/Data.php b/app/code/Magento/Ui/Config/Data.php index a47b5cbc41e55..9c33eaf3fcf95 100644 --- a/app/code/Magento/Ui/Config/Data.php +++ b/app/code/Magento/Ui/Config/Data.php @@ -84,7 +84,6 @@ public function __construct( $this->componentName = $componentName; $this->argumentInterpreter = $argumentInterpreter; $this->cacheId = static::CACHE_ID . '_' . $componentName; - $this->initData(); } /** @@ -121,7 +120,7 @@ private function initData() */ public function merge(array $config) { - $this->data = array_replace_recursive($this->data, $config); + $this->data = array_replace_recursive($this->get(), $config); } /** @@ -133,6 +132,9 @@ public function merge(array $config) */ public function get($path = null, $default = null) { + if (empty($this->data)) { + $this->initData(); + } if ($path === null) { return $this->data; } diff --git a/dev/tests/integration/testsuite/Magento/Ui/Component/ConfigurationTest.php b/dev/tests/integration/testsuite/Magento/Ui/Component/ConfigurationTest.php index 087fc03b0e3c1..0972c705cdb35 100644 --- a/dev/tests/integration/testsuite/Magento/Ui/Component/ConfigurationTest.php +++ b/dev/tests/integration/testsuite/Magento/Ui/Component/ConfigurationTest.php @@ -53,9 +53,6 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase 'argument[@name="data"]/item[@name="config"]/item[@name="multiple"]' => [ '//*[@formElement="select"]', '//*[substring(@component, string-length(@component) - string-length("ui-group") +1) = "ui-group"]' - ], - 'argument[@name="block"]' => [ - '//*[@name="html_content"]' ] ]; diff --git a/lib/internal/Magento/Framework/Component/ComponentRegistrar.php b/lib/internal/Magento/Framework/Component/ComponentRegistrar.php index 6e09052f8c8e7..94fbab98423d9 100644 --- a/lib/internal/Magento/Framework/Component/ComponentRegistrar.php +++ b/lib/internal/Magento/Framework/Component/ComponentRegistrar.php @@ -46,8 +46,6 @@ class ComponentRegistrar implements ComponentRegistrarInterface */ public static function register($type, $componentName, $path) { - $path = str_replace("magento2ee", "magento2ce", $path); - $path = str_replace("magento2b2b", "magento2ce", $path); self::validateType($type); if (isset(self::$paths[$type][$componentName])) { throw new \LogicException( diff --git a/lib/internal/Magento/Framework/View/Layout/Reader/UiComponent.php b/lib/internal/Magento/Framework/View/Layout/Reader/UiComponent.php index 6b45d12a48935..3d2bee67229cd 100644 --- a/lib/internal/Magento/Framework/View/Layout/Reader/UiComponent.php +++ b/lib/internal/Magento/Framework/View/Layout/Reader/UiComponent.php @@ -96,7 +96,10 @@ public function interpret(Context $readerContext, Element $currentElement) ); $scheduledStructure->setStructureElementData($referenceName, ['attributes' => $attributes]); - foreach ($this->getLayoutElementsFromUiConfiguration($referenceName) as $layoutElement) { + $elements = []; + $config = $this->uiConfigFactory->create(['componentName' => $referenceName])->get($referenceName); + $this->getLayoutElementsFromUiConfiguration([$referenceName => $config], $elements); + foreach ($elements as $layoutElement) { $layoutElement = simplexml_load_string( $layoutElement, Element::class @@ -110,19 +113,20 @@ public function interpret(Context $readerContext, Element $currentElement) /** * Find layout elements in UI configuration for correct layout generation * - * @param string $uiConfigName - * @return array + * @param array $config + * @param array $elements + * @return void */ - private function getLayoutElementsFromUiConfiguration($uiConfigName) + private function getLayoutElementsFromUiConfiguration(array $config, array &$elements = []) { - $elements = []; - $config = $this->uiConfigFactory->create(['componentName' => $uiConfigName])->get($uiConfigName); - foreach ($config['children'] as $name => $data) { + foreach ($config as $data) { if (isset($data['arguments']['block']['layout'])) { - $elements[$name] = $data['arguments']['block']['layout']; + $elements[] = $data['arguments']['block']['layout']; + } + if (isset($data['children']) && !empty($data['children'])) { + $this->getLayoutElementsFromUiConfiguration($data['children'], $elements); } } - return $elements; } /**