Skip to content

Commit 41fbde6

Browse files
committed
MC-3305: Architectural Review for MC-1416
Format and move JSON serialization to block class
1 parent 06299eb commit 41fbde6

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

app/code/Magento/PageBuilder/Block/Wysiwyg.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,17 @@ public function __construct(
3737

3838
/**
3939
* Get config for wysiwyg initialization
40-
* @return \Magento\Framework\DataObject
40+
*
41+
* @return string
4142
*/
42-
public function getConfig() : DataObject
43+
public function getConfigJson() : string
4344
{
4445
$config = $this->config->getConfig();
4546

4647
if (is_array($config)) {
4748
$config = new DataObject($config);
4849
}
4950

50-
return $config;
51+
return $config->toJson();
5152
}
5253
}

app/code/Magento/PageBuilder/view/base/templates/wysiwyg.phtml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
/** @var Magento\PageBuilder\Block\Wysiwyg $block */
8-
96
?>
7+
<?php /** @var Magento\PageBuilder\Block\Wysiwyg $block */ ?>
108
<script>
119
require.config({
1210
config: {
1311
'mage/adminhtml/wysiwyg/tiny_mce/setup': {
14-
config: <?= /* @escapeNotVerified */ $block->getConfig()->toJson() ?>
12+
config: <?= /* @noEscape */ $block->getConfigJson() ?>
1513
}
1614
}
1715
});

0 commit comments

Comments
 (0)