summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Kersten <jke@odoo.com>2014-07-24 18:12:32 +0200
committerJeremy Kersten <jke@odoo.com>2014-07-24 18:12:32 +0200
commit89e8626ab032a24c839ca2d87a3257f01b64d44a (patch)
treecfcd81be7cc1b1e1c0bad0fef1e25d1b64325c27
parent335e4a8cc34151a0369dc887efa2334f20b5c0b6 (diff)
[FIX] website: catch exception on destroy of ckeditor to allow the modifications to be saved anyway
-rw-r--r--addons/website/static/src/js/website.editor.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index 93d75429352..a05c226a683 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')