From 89e8626ab032a24c839ca2d87a3257f01b64d44a Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Thu, 24 Jul 2014 18:12:32 +0200 Subject: [PATCH] [FIX] website: catch exception on destroy of ckeditor to allow the modifications to be saved anyway --- addons/website/static/src/js/website.editor.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index 93d7542..a05c226 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -546,7 +546,13 @@ observer.disconnect(); var editor = this.rte.editor; var root = editor.element.$; - editor.destroy(); + try { + editor.destroy(); + } + catch(err) { + // Hack to avoid the lost of all changes because ckeditor fails in destroy + console.log("Error in editor.destroy() : " + err.toString() + "\n " + err.stack); + } // FIXME: select editables then filter by dirty? var defs = this.rte.fetch_editables(root) .filter('.oe_dirty') -- 1.7.10.4