From d6f824be6377618172c2cbf04ebc57deded1e339 Mon Sep 17 00:00:00 2001 From: Gorash Date: Mon, 17 Jun 2019 10:47:45 +0000 Subject: [PATCH] [FIX] website: editor wysiwyg must remove edition flags html is undefined then the content are not replaced by the cleaned dom. Change the _onActivateSnippet method to fix the previous error generated by the dom uncleaned. Issue introduced by https://github.com/odoo/odoo/commit/2e8222dee737215cbad0dd3556d6ec0ffe60bf00#diff-0f47e7e6900726ed7c5d97ff649ae05bR228 closes odoo/odoo#34181 Signed-off-by: Quentin Smetz (qsm) --- addons/website/static/src/js/editor/wysiwyg_multizone.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/website/static/src/js/editor/wysiwyg_multizone.js b/addons/website/static/src/js/editor/wysiwyg_multizone.js index 4509816c30e..d02fddc2545 100644 --- a/addons/website/static/src/js/editor/wysiwyg_multizone.js +++ b/addons/website/static/src/js/editor/wysiwyg_multizone.js @@ -239,8 +239,8 @@ var WysiwygMultizone = Wysiwyg.extend({ } var _super = this._super.bind(this); return this.savingMutex.lock.then(function () { - return _super().then(function (_isDirty, html) { - this._summernote.layoutInfo.editable.html(html); + return _super().then(function (res) { + this._summernote.layoutInfo.editable.html(res.html); var $editable = this._getEditableArea(); var $areaDirty = $editable.filter('.o_dirty'); @@ -493,7 +493,7 @@ var WysiwygMultizone = Wysiwyg.extend({ if (!$.contains(ev.data[0], this._focusedNode)) { this._focusedNode = ev.data[0]; } - ev.data.closest('.oe_structure > *:not(.o_fake_editable)').addClass('o_fake_editable').attr('contenteditable', true); + ev.data.closest('.oe_structure > *:o_editable').addClass('o_fake_editable').attr('contenteditable', true); }, /** * @override