[FIX] web_editor: html_frame: saving in readonly

A form view record may be saved even if the record is displayed in
readonly (e.g. when a button in the form view is clicked). When
this happened, if there were an html field with html_frame widget
in the form, it crashed (e.g. in Email Marketing > Mass Mailings >
open one > click on Test Mailing).
This commit is contained in:
Aaron Bohy
2017-08-10 13:56:22 +02:00
parent 87133a8235
commit deba788b4c
2 changed files with 31 additions and 1 deletions
+1 -1
View File
@@ -383,7 +383,7 @@ var FieldTextHtml = AbstractField.extend({
* @override
*/
commitChanges: function () {
if (!this.loaded) {
if (!this.loaded || this.mode === 'readonly') {
return;
}
// switch to WYSIWYG mode if currently in code mode to get all changes