Skip to content

Commit 8d14d48

Browse files
author
Olga Kopylova
committed
MAGETWO-45017: [github] Widget editing does not work: «Uncaught TypeError: Cannot read property 'innerHTML' of null» (and my fix) #2235
- removed escaping, as it converts '\' to '\\' and select of widget type has type with single '\', so edit popup doesn't work
1 parent f009ffb commit 8d14d48

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

app/code/Magento/Widget/Model/Widget.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ public function getWidgetsArray($filters = [])
277277
*/
278278
public function getWidgetDeclaration($type, $params = [], $asIs = true)
279279
{
280-
$directive = '{{widget type="' . preg_quote($type) . '"';
280+
$directive = '{{widget type="' . $type . '"';
281281

282282
foreach ($params as $name => $value) {
283283
// Retrieve default option value if pre-configured

app/code/Magento/Widget/Test/Unit/Model/WidgetTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,6 @@ public function testGetWidgetByClassType()
7575
$this->assertNull($this->widget->getWidgetByClassType('type2'));
7676
}
7777

78-
public function testGetWidgetDeclarationTypeWithBackslashes()
79-
{
80-
$this->assertContains(
81-
'Magento\\\\Widget\\\\Backslashed\\\\ClassName',
82-
$this->widget->getWidgetDeclaration('Magento\Widget\Backslashed\ClassName')
83-
);
84-
}
85-
8678
public function testGetConfigAsObject()
8779
{
8880
$configFile = __DIR__ . '/_files/mappedConfigArrayAll.php';

0 commit comments

Comments
 (0)