From 9fe3bda432c574f5656bd89e05496de8617ed2aa Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 10 Oct 2013 11:57:18 +0000 Subject: [PATCH] - Don't try to translate config - Better error message if destroying CKEDITOR fails - Handle failing destroy, and make sure widget is completely removed --- etemplate/js/et2_widget_htmlarea.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/etemplate/js/et2_widget_htmlarea.js b/etemplate/js/et2_widget_htmlarea.js index df067037f0..ba6270bd4c 100644 --- a/etemplate/js/et2_widget_htmlarea.js +++ b/etemplate/js/et2_widget_htmlarea.js @@ -62,7 +62,8 @@ var et2_htmlarea = et2_inputWidget.extend( 'name': 'Internal configuration', 'type':'any', 'default': et2_no_init, - 'description': 'Internal configuration - managed by preferences & framework, passed in here' + 'description': 'Internal configuration - managed by preferences & framework, passed in here', + 'translate': 'no_lang' }, }, @@ -90,9 +91,9 @@ var et2_htmlarea = et2_inputWidget.extend( transformAttributes: function(_attrs) { // Check mode, some apps jammed everything in there - if(jQuery.inArray(_attrs['mode'], this.modes) < 0) + if(_attrs['mode'] && jQuery.inArray(_attrs['mode'], this.modes) < 0) { - this.egw().debug("warn", "Invalid mode for '%s': %s Valid options:", _attrs['id'],_attrs['mode'], this.modes); + this.egw().debug("warn", "'%s' is an invalid mode for htmlarea '%s'. Valid options:", _attrs['mode'],_attrs['id'], this.modes); var list = _attrs['mode'].split(','); for(var i = 0; i < list.length && i < this.legacyOptions.length; i++) { @@ -140,9 +141,13 @@ var et2_htmlarea = et2_inputWidget.extend( } catch (e) { - this.egw().debug("warn",e); - this.htmlNode = null; + this.egw().debug("warn","Removing CKEDITOR: " + e.message, this,e); + // Finish it + delete CKEDITOR.instances[this.dom_id]; } + this.htmlNode.remove(); + this.htmlNode = null; + this._super.apply(this, arguments); }, set_value: function(_value) { this._oldValue = _value;