0012146: Message body isn't saved in Draft
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 1 Sep 2016 14:58:32 +0000 (16:58 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 2 Sep 2016 11:18:18 +0000 (13:18 +0200)
* applied the patch by  SOWIWAS (Theodor van Nahl <theo_dev@van-nahl.org>)
 - thanks for that!

https://forge.tine20.org/view.php?id=12146

Change-Id: Id057b4e220f42022320bd6cec197482d5185e32d
Reviewed-on: http://gerrit.tine20.com/customers/3509
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Felamimail/js/MessageEditDialog.js

index abf7a60..621cfe2 100644 (file)
@@ -984,6 +984,14 @@ Tine.Felamimail.MessageEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
     onRecordUpdate: function() {
         this.record.data.attachments = [];
         var attachmentData = null;
+
+        var format = this.bodyCards.layout.activeItem.mimeType;
+        if (format.match(/^text/)) {
+            var editor = format == 'text/html' ? this.htmlEditor : this.textEditor;
+
+            this.record.set('content_type', format);
+            this.record.set('body', editor.getValue());
+        }
         
         this.attachmentGrid.store.each(function(attachment) {
             this.record.data.attachments.push(Ext.ux.file.Upload.file.getFileData(attachment));
@@ -1283,14 +1291,6 @@ Tine.Felamimail.MessageEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
             return;
         }
 
-        var format = this.bodyCards.layout.activeItem.mimeType;
-        if (format.match(/^text/)) {
-            var editor = format == 'text/html' ? this.htmlEditor : this.textEditor;
-
-            this.record.set('content_type', format);
-            this.record.set('body', editor.getValue());
-        }
-
         Tine.log.debug('Tine.Felamimail.MessageEditDialog::doApplyChanges - call parent');
         this.doApplyChanges(closeWindow);