Skip to content

Commit d136823

Browse files
committed
MC-4137: TinyMCE Issues within inline WYSIWYG
- Resolve serialisation issue
1 parent c8928f4 commit d136823

File tree

2 files changed

+10
-2
lines changed
  • app/code/Magento/PageBuilder/view/adminhtml/web

2 files changed

+10
-2
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/master-format/render/serialize.js

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/master-format/render/serialize.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,9 @@ export function getSerializedTree(contentType: ContentTypeInterface) {
5353
* @param contentType
5454
*/
5555
function getData(contentType: ContentTypeInterface): GeneratedElementsData {
56-
return contentType.dataStore.getState() || {};
56+
/**
57+
* Flip flop to JSON and back again to ensure all data is serializable. Magento by default adds functions into
58+
* some basic types which cannot be serialized when calling PostMessage.
59+
*/
60+
return JSON.parse(JSON.stringify(contentType.dataStore.getState())) || {};
5761
}

0 commit comments

Comments
 (0)