Skip to content

Commit 6f4228a

Browse files
committed
MC-18761: Fix incorrect website name rendering
1 parent 3e1bd1e commit 6f4228a

File tree

4 files changed

+18
-25
lines changed

4 files changed

+18
-25
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
@@ -186,6 +186,7 @@ protected function getFieldsForFieldset()
186186
'componentType' => Form\Field::NAME,
187187
'formElement' => Form\Element\Checkbox::NAME,
188188
'description' => __($website['name']),
189+
'__disableTmpl' => true,
189190
'tooltip' => $tooltip,
190191
'sortOrder' => $sortOrder,
191192
'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/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 (!empty($values)) {

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,15 @@ public function getStoreValuesForFormDataProvider()
271271
[
272272
'label' => str_repeat($nonEscapableNbspChar, 4) . $groupName,
273273
'value' => [
274-
['label' => str_repeat($nonEscapableNbspChar, 4) . $storeName, 'value' => $storeId]
274+
[
275+
'label' => str_repeat($nonEscapableNbspChar, 4) . $storeName,
276+
'value' => $storeId,
277+
'__disableTmpl' => true,
278+
],
275279
],
276280
'__disableTmpl' => true
277281
],
278-
]
282+
],
279283
],
280284
];
281285
}

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

Lines changed: 7 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,26 @@ 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;
102+
120103
}
121104
}
122105
}
123106
if (!empty($groups)) {
124-
$name = $this->sanitizeName($website->getName());
107+
$name = $website->getName();
125108
$this->currentOptions[$name]['label'] = $name;
126109
$this->currentOptions[$name]['value'] = array_values($groups);
110+
$this->currentOptions[$name]['__disableTmpl'] = true;
127111
}
128112
}
129113
}

0 commit comments

Comments
 (0)