[FIX] web: fix ace editor when value is False

Avoid to crash the client web with setValue(false).
false.match, false.split, false.length... will not works.

Before this commit, _render call the setValue after comparing '' !== false
This commit is contained in:
Jeremy Kersten
2018-06-15 12:12:26 +02:00
parent c4f5b9f751
commit d702e82b9c
@@ -2431,6 +2431,21 @@ var AceEditor = DebouncedField.extend({
// Private
//--------------------------------------------------------------------------
/**
* Format value
*
* Note: We have to overwrite this method to always return a string.
* AceEditor works with string and not boolean value.
*
* @override
* @private
* @param {boolean|string} value
* @returns {string}
*/
_formatValue: function (value) {
return this._super.apply(this, arguments) || '';
},
/**
* @override
* @private
@@ -2453,6 +2468,7 @@ var AceEditor = DebouncedField.extend({
this.aceSession.setValue(newValue);
}
},
/**
* Starts the ace library on the given DOM element. This initializes the
* ace editor option according to the edit/readonly mode and binds ace