Skip to content

Commit 081a3b7

Browse files
committed
11792: Can't add customizable options to product
1 parent 148da00 commit 081a3b7

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/CustomOptionsTest.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,17 @@ public function testModifyMeta()
154154
->method('getAll')
155155
->willReturn([]);
156156

157-
$this->assertArrayHasKey(CustomOptions::GROUP_CUSTOM_OPTIONS_NAME, $this->getModel()->modifyMeta([]));
157+
$meta = $this->getModel()->modifyMeta([]);
158+
159+
$this->assertArrayHasKey(CustomOptions::GROUP_CUSTOM_OPTIONS_NAME, $meta);
160+
161+
$buttonAdd = $meta['custom_options']['children']['container_header']['children']['button_add'];
162+
$buttonAddTargetName = $buttonAdd['arguments']['data']['config']['actions'][0]['targetName'];
163+
$expectedTargetName = '${ $.ns }.${ $.ns }.' . CustomOptions::GROUP_CUSTOM_OPTIONS_NAME
164+
. '.' . CustomOptions::GRID_OPTIONS_NAME;
165+
166+
$this->assertEquals($expectedTargetName, $buttonAddTargetName);
167+
158168
}
159169

160170
/**

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ protected function getHeaderContainerConfig($sortOrder)
348348
'sortOrder' => 20,
349349
'actions' => [
350350
[
351-
'targetName' => 'ns = ${ $.ns }, index = ' . static::GRID_OPTIONS_NAME,
351+
'targetName' => '${ $.ns }.${ $.ns }.' . static::GROUP_CUSTOM_OPTIONS_NAME
352+
. '.' . static::GRID_OPTIONS_NAME,
352353
'actionName' => 'processingAddChild',
353354
]
354355
]

0 commit comments

Comments
 (0)