Skip to content

Commit eb91c20

Browse files
authored
Merge pull request #4963 from magento-tsg/2.2.11-develop-pr120
[TSG] Fixes for 2.2 (pr120) (2.2.11-develop)
2 parents 8df459c + 5551a35 commit eb91c20

File tree

12 files changed

+100
-66
lines changed

12 files changed

+100
-66
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ protected function getFieldsForFieldset()
188188
'componentType' => Form\Field::NAME,
189189
'formElement' => Form\Element\Checkbox::NAME,
190190
'description' => __($website['name']),
191+
'__disableTmpl' => true,
191192
'tooltip' => $tooltip,
192193
'sortOrder' => $sortOrder,
193194
'dataScope' => 'website_ids.' . $website['id'],
@@ -353,18 +354,21 @@ protected function getWebsitesOptionsList()
353354
$websiteOption = [
354355
'value' => '0.' . $website['id'],
355356
'label' => __($website['name']),
357+
'__disableTmpl' => true,
356358
];
357359
$groupOptions = [];
358360
foreach ($website['groups'] as $group) {
359361
$groupOption = [
360362
'value' => '0.' . $website['id'] . '.' . $group['id'],
361363
'label' => __($group['name']),
364+
'__disableTmpl' => true,
362365
];
363366
$storeViewOptions = [];
364367
foreach ($group['stores'] as $storeView) {
365368
$storeViewOptions[] = [
366369
'value' => $storeView['id'],
367370
'label' => __($storeView['name']),
371+
'__disableTmpl' => true,
368372
];
369373
}
370374
if (!empty($storeViewOptions)) {

app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/Cms/OptionsTest.php

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function testToOptionArray()
7171
$expectedOptions = [
7272
[
7373
'label' => __('All Store Views'),
74-
'value' => '0'
74+
'value' => '0',
7575
],
7676
[
7777
'label' => 'Main Website',
@@ -81,11 +81,14 @@ public function testToOptionArray()
8181
'value' => [
8282
[
8383
'label' => ' Default Store View',
84-
'value' => '1'
84+
'value' => '1',
85+
'__disableTmpl' => true,
8586
]
86-
]
87+
],
88+
'__disableTmpl' => true,
8789
]
88-
]
90+
],
91+
'__disableTmpl' => true,
8992
]
9093
];
9194

@@ -104,14 +107,6 @@ public function testToOptionArray()
104107
$this->storeMock->expects($this->atLeastOnce())->method('getName')->willReturn('Default Store View');
105108
$this->storeMock->expects($this->atLeastOnce())->method('getId')->willReturn('1');
106109

107-
$this->escaperMock->expects($this->atLeastOnce())->method('escapeHtml')->willReturnMap(
108-
[
109-
['Default Store View', null, 'Default Store View'],
110-
['Main Website Store', null, 'Main Website Store'],
111-
['Main Website', null, 'Main Website']
112-
]
113-
);
114-
115110
$this->assertEquals($expectedOptions, $this->options->toOptionArray());
116111
}
117112
}

app/code/Magento/Config/Test/Unit/Block/System/Config/Form/Field/ImageTest.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
/**
8-
* Tests for \Magento\Framework\Data\Form\Field\Image
8+
* Test for \Magento\Framework\Data\Form\Field\Image.
99
*/
1010
namespace Magento\Config\Test\Unit\Block\System\Config\Form\Field;
1111

@@ -60,6 +60,8 @@ protected function setUp()
6060
}
6161

6262
/**
63+
* Get element with value and check data.
64+
*
6365
* @covers \Magento\Config\Block\System\Config\Form\Field\Image::_getUrl
6466
*/
6567
public function testGetElementHtmlWithValue()
@@ -100,7 +102,17 @@ public function testGetElementHtmlWithValue()
100102
. $this->testData['html_id']
101103
. $this->testData['html_id_suffix'];
102104

105+
$this->escaperMock->expects($this->once())
106+
->method('escapeUrl')
107+
->with($url . $this->testData['path'] . '/' . $this->testData['value'])
108+
->willReturn($url . $this->testData['path'] . '/' . $this->testData['value']);
109+
$this->escaperMock->expects($this->exactly(3))
110+
->method('escapeHtmlAttr')
111+
->with($this->testData['value'])
112+
->willReturn($this->testData['value']);
113+
$this->escaperMock->expects($this->atLeastOnce())->method('escapeHtml')->willReturn($expectedHtmlId);
103114
$html = $this->image->getElementHtml();
115+
104116
$this->assertContains('class="input-file"', $html);
105117
$this->assertContains('<input', $html);
106118
$this->assertContains('type="file"', $html);

app/code/Magento/CustomerImportExport/Model/Export/Customer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ protected function _getEntityCollection()
139139
}
140140

141141
/**
142-
* {@inheritdoc}
142+
* @inheritdoc
143143
*/
144144
protected function _getHeaderColumns()
145145
{
146146
$validAttributeCodes = $this->_getExportAttributeCodes();
147-
return array_merge($this->_permanentAttributes, $validAttributeCodes, ['password']);
147+
return array_merge($this->_permanentAttributes, $validAttributeCodes);
148148
}
149149

150150
/**

app/code/Magento/Store/Model/System/Store.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ public function getStoreValuesForForm($empty = false, $all = false)
142142
$values[] = [
143143
'label' => str_repeat($nonEscapableNbspChar, 4) . $store->getName(),
144144
'value' => $store->getId(),
145+
'__disableTmpl' => true,
145146
];
146147
}
147148
if ($groupShow) {

app/code/Magento/Store/Test/Unit/Model/System/StoreTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,11 @@ public function getStoreValuesForFormDataProvider()
268268
[
269269
'label' => str_repeat($nonEscapableNbspChar, 4) . $groupName,
270270
'value' => [
271-
['label' => str_repeat($nonEscapableNbspChar, 4) . $storeName, 'value' => $storeId]
271+
[
272+
'label' => str_repeat($nonEscapableNbspChar, 4) . $storeName,
273+
'value' => $storeId,
274+
'__disableTmpl' => true,
275+
]
272276
],
273277
'__disableTmpl' => true
274278
],

app/code/Magento/Store/Ui/Component/Listing/Column/Store/Options.php

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,6 @@ public function toOptionArray()
6868
return $this->options;
6969
}
7070

71-
/**
72-
* Sanitize website/store option name
73-
*
74-
* @param string $name
75-
*
76-
* @return string
77-
*/
78-
protected function sanitizeName($name)
79-
{
80-
$matches = [];
81-
preg_match('/\$[:]*{(.)*}/', $name, $matches);
82-
if (count($matches) > 0) {
83-
$name = $this->escaper->escapeHtml($this->escaper->escapeJs($name));
84-
} else {
85-
$name = $this->escaper->escapeHtml($name);
86-
}
87-
88-
return $name;
89-
}
90-
9171
/**
9272
* Generate current options
9373
*
@@ -108,22 +88,25 @@ protected function generateCurrentOptions()
10888
/** @var \Magento\Store\Model\Store $store */
10989
foreach ($storeCollection as $store) {
11090
if ($store->getGroupId() == $group->getId()) {
111-
$name = $this->sanitizeName($store->getName());
91+
$name = $store->getName();
11292
$stores[$name]['label'] = str_repeat(' ', 8) . $name;
11393
$stores[$name]['value'] = $store->getId();
94+
$stores[$name]['__disableTmpl'] = true;
11495
}
11596
}
11697
if (!empty($stores)) {
117-
$name = $this->sanitizeName($group->getName());
98+
$name = $group->getName();
11899
$groups[$name]['label'] = str_repeat(' ', 4) . $name;
119100
$groups[$name]['value'] = array_values($stores);
101+
$groups[$name]['__disableTmpl'] = true;
120102
}
121103
}
122104
}
123105
if (!empty($groups)) {
124-
$name = $this->sanitizeName($website->getName());
106+
$name = $website->getName();
125107
$this->currentOptions[$name]['label'] = $name;
126108
$this->currentOptions[$name]['value'] = array_values($groups);
109+
$this->currentOptions[$name]['__disableTmpl'] = true;
127110
}
128111
}
129112
}

dev/tests/functional/tests/app/Magento/Analytics/Test/TestCase/NavigateMenuTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Backend\Test\TestCase\NavigateMenuTest" summary="Navigate to menu chapter">
1010
<variation name="NavigateMenuTestBIEssentials" summary="Navigate through BI Essentials admin menu to Sign Up page" ticketId="MAGETWO-63700">
11+
<data name="issue" xsi:type="string">MC-22618: [MTF] Fix NavigateMenuTestBIEssentials test</data>
1112
<data name="menuItem" xsi:type="string">Reports > BI Essentials</data>
1213
<data name="waitMenuItemNotVisible" xsi:type="boolean">false</data>
1314
<data name="businessIntelligenceLink" xsi:type="string">https://account.magento.com/onboarding/steps/view/step/gmv/</data>

dev/tests/integration/testsuite/Magento/UrlRewrite/Block/Catalog/Edit/FormTest.php

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,11 @@ public static function getEntityStoresDataProvider()
237237
['label' => 'Main Website', 'value' => [], '__disableTmpl' => true],
238238
[
239239
'label' => '    Main Website Store',
240-
'value' => [['label' => '    Default Store View', 'value' => 1]],
241-
'__disableTmpl' => true
242-
]
240+
'value' => [
241+
['label' => '    Default Store View', 'value' => 1, '__disableTmpl' => true],
242+
],
243+
'__disableTmpl' => true,
244+
],
243245
],
244246
],
245247
[
@@ -249,10 +251,12 @@ public static function getEntityStoresDataProvider()
249251
['label' => 'Main Website', 'value' => [], '__disableTmpl' => true],
250252
[
251253
'label' => '    Main Website Store',
252-
'value' => [['label' => '    Default Store View', 'value' => 1]],
253-
'__disableTmpl' => true
254-
]
255-
]
254+
'value' => [
255+
['label' => '    Default Store View', 'value' => 1, '__disableTmpl' => true],
256+
],
257+
'__disableTmpl' => true,
258+
],
259+
],
256260
],
257261
[
258262
['entity_id' => 2, 'name' => 'product2', 'url_key' => 'product2', 'store_ids' => [1]],
@@ -261,11 +265,13 @@ public static function getEntityStoresDataProvider()
261265
['label' => 'Main Website', 'value' => [], '__disableTmpl' => true],
262266
[
263267
'label' => '    Main Website Store',
264-
'value' => [['label' => '    Default Store View', 'value' => 1]],
265-
'__disableTmpl' => true
266-
]
267-
]
268-
]
268+
'value' => [
269+
['label' => '    Default Store View', 'value' => 1, '__disableTmpl' => true],
270+
],
271+
'__disableTmpl' => true,
272+
],
273+
],
274+
],
269275
];
270276
}
271277
}

dev/tests/integration/testsuite/Magento/UrlRewrite/Block/Cms/Page/Edit/FormTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ public function testGetEntityStores()
8181
['label' => 'Main Website', 'value' => [], '__disableTmpl' => true],
8282
[
8383
'label' => '    Main Website Store',
84-
'value' => [['label' => '    Default Store View', 'value' => 1]],
85-
'__disableTmpl' => true
84+
'value' => [
85+
['label' => '    Default Store View', 'value' => 1, '__disableTmpl' => true]
86+
],
87+
'__disableTmpl' => true,
8688
],
8789
];
8890
$this->assertEquals($expectedStores, $form->getElement('store_id')->getValues());

0 commit comments

Comments
 (0)