diff --git a/CHANGELOG.md b/CHANGELOG.md index bcf9243..3f44a38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ ### Fixed * fix the mail notifier * fix sitemap: navigation with several domains +* fix regression with editorjs: content not loaded ## [1.14.1] - 2022-04-30 ### Added diff --git a/src/core/Resources/assets/js/modules/editorjs.js b/src/core/Resources/assets/js/modules/editorjs.js index b7fd984..cd9f331 100644 --- a/src/core/Resources/assets/js/modules/editorjs.js +++ b/src/core/Resources/assets/js/modules/editorjs.js @@ -147,21 +147,17 @@ const doInitEditor = () => { editorContainer.attr('id', id) element.hide() - let data = [] + let data = {time: null, blocks: []}; try { const value = JSON.parse(element.val()) - if (Array.isArray(value)) { + if (value.time && Array.isArray(value.blocks)) { data = value } } catch (e) { } - if (!Array.isArray(data)) { - data = [] - } - const editor = new EditorJS(buildConfiguration({ holder: id, data: data,