Skip to content

Commit 6ef3521

Browse files
committed
Merge remote-tracking branch 'origin/develop' into PR-1904
2 parents 571946e + e0bd129 commit 6ef3521

File tree

8 files changed

+23
-22
lines changed

8 files changed

+23
-22
lines changed

app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@
424424
</settings>
425425
<container name="assign_products_container" sortOrder="160">
426426
<htmlContent name="html_content">
427-
<argument name="block" xsi:type="object">Magento\Catalog\Block\Adminhtml\Category\AssignProducts</argument>
427+
<block name="gallery" class="Magento\Catalog\Block\Adminhtml\Category\AssignProducts"/>
428428
</htmlContent>
429429
</container>
430430
</fieldset>

app/code/Magento/GoogleOptimizer/view/adminhtml/ui_component/category_form.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</settings>
1414
<container name="google_experiment_container" sortOrder="250">
1515
<htmlContent name="html_content">
16-
<argument name="block" xsi:type="object">Magento\GoogleOptimizer\Block\Adminhtml\Catalog\Category\Edit\Googleoptimizer</argument>
16+
<block name="googleoptimizer" class="Magento\GoogleOptimizer\Block\Adminhtml\Catalog\Category\Edit\Googleoptimizer"/>
1717
</htmlContent>
1818
</container>
1919
</fieldset>

app/code/Magento/GoogleOptimizer/view/adminhtml/ui_component/cms_page_form.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</settings>
1414
<container name="google_experiment_container" sortOrder="250">
1515
<htmlContent name="html_content">
16-
<argument name="block" xsi:type="object">Magento\GoogleOptimizer\Block\Adminhtml\Form\CmsPage</argument>
16+
<block name="googleOptimizerBlockAdminhtmlFormCmsPage" class="MagentoGoogleOptimizerBlockAdminhtmlFormCmsPage"/>
1717
</htmlContent>
1818
</container>
1919
</fieldset>

app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@
409409
</settings>
410410
<container name="conditions_apply_to" sortOrder="10">
411411
<htmlContent name="html_content">
412-
<argument name="block" xsi:type="object">Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Conditions</argument>
412+
<block name="conditions_apply_to" class="Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Conditions" />
413413
</htmlContent>
414414
</container>
415415
</fieldset>
@@ -521,7 +521,7 @@
521521
</field>
522522
<container name="actions_apply_to" sortOrder="40">
523523
<htmlContent name="html_content">
524-
<argument name="block" xsi:type="object">Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Actions</argument>
524+
<block name="actions_apply_to" class="Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Actions"/>
525525
</htmlContent>
526526
</container>
527527
</fieldset>
@@ -544,7 +544,7 @@
544544
</field>
545545
<container name="store_view_labels" sortOrder="40">
546546
<htmlContent name="html_content">
547-
<argument name="block" xsi:type="object">Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Labels</argument>
547+
<block name="store_view_labels" class="Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Labels"/>
548548
</htmlContent>
549549
</container>
550550
</fieldset>

app/code/Magento/Ui/Config/Data.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ public function __construct(
8484
$this->componentName = $componentName;
8585
$this->argumentInterpreter = $argumentInterpreter;
8686
$this->cacheId = static::CACHE_ID . '_' . $componentName;
87-
$this->initData();
8887
}
8988

9089
/**
@@ -121,7 +120,7 @@ private function initData()
121120
*/
122121
public function merge(array $config)
123122
{
124-
$this->data = array_replace_recursive($this->data, $config);
123+
$this->data = array_replace_recursive($this->get(), $config);
125124
}
126125

127126
/**
@@ -133,6 +132,9 @@ public function merge(array $config)
133132
*/
134133
public function get($path = null, $default = null)
135134
{
135+
if (empty($this->data)) {
136+
$this->initData();
137+
}
136138
if ($path === null) {
137139
return $this->data;
138140
}

dev/tests/integration/testsuite/Magento/Ui/Component/ConfigurationTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
5353
'argument[@name="data"]/item[@name="config"]/item[@name="multiple"]' => [
5454
'//*[@formElement="select"]',
5555
'//*[substring(@component, string-length(@component) - string-length("ui-group") +1) = "ui-group"]'
56-
],
57-
'argument[@name="block"]' => [
58-
'//*[@name="html_content"]'
5956
]
6057
];
6158

lib/internal/Magento/Framework/Component/ComponentRegistrar.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ class ComponentRegistrar implements ComponentRegistrarInterface
4646
*/
4747
public static function register($type, $componentName, $path)
4848
{
49-
$path = str_replace("magento2ee", "magento2ce", $path);
50-
$path = str_replace("magento2b2b", "magento2ce", $path);
5149
self::validateType($type);
5250
if (isset(self::$paths[$type][$componentName])) {
5351
throw new \LogicException(

lib/internal/Magento/Framework/View/Layout/Reader/UiComponent.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ public function interpret(Context $readerContext, Element $currentElement)
9696
);
9797
$scheduledStructure->setStructureElementData($referenceName, ['attributes' => $attributes]);
9898

99-
foreach ($this->getLayoutElementsFromUiConfiguration($referenceName) as $layoutElement) {
99+
$elements = [];
100+
$config = $this->uiConfigFactory->create(['componentName' => $referenceName])->get($referenceName);
101+
$this->getLayoutElementsFromUiConfiguration([$referenceName => $config], $elements);
102+
foreach ($elements as $layoutElement) {
100103
$layoutElement = simplexml_load_string(
101104
$layoutElement,
102105
Element::class
@@ -110,19 +113,20 @@ public function interpret(Context $readerContext, Element $currentElement)
110113
/**
111114
* Find layout elements in UI configuration for correct layout generation
112115
*
113-
* @param string $uiConfigName
114-
* @return array
116+
* @param array $config
117+
* @param array $elements
118+
* @return void
115119
*/
116-
private function getLayoutElementsFromUiConfiguration($uiConfigName)
120+
private function getLayoutElementsFromUiConfiguration(array $config, array &$elements = [])
117121
{
118-
$elements = [];
119-
$config = $this->uiConfigFactory->create(['componentName' => $uiConfigName])->get($uiConfigName);
120-
foreach ($config['children'] as $name => $data) {
122+
foreach ($config as $data) {
121123
if (isset($data['arguments']['block']['layout'])) {
122-
$elements[$name] = $data['arguments']['block']['layout'];
124+
$elements[] = $data['arguments']['block']['layout'];
125+
}
126+
if (isset($data['children']) && !empty($data['children'])) {
127+
$this->getLayoutElementsFromUiConfiguration($data['children'], $elements);
123128
}
124129
}
125-
return $elements;
126130
}
127131

128132
/**

0 commit comments

Comments
 (0)