diff --git a/NEWS b/NEWS index 60e3456c1..a51a68c80 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,7 @@ Bug fixes - [eas] properly escape all email and address fields - [web] restored functionality to save unknown recipient emails to address book on send - [web] fixed ripple blocking the form when submitting no values (#3808) + - [web] fixed error handling when renaming a mailbox - [core] strip protocol value from proxyAddresses attribute (#3182) 3.1.5 (2016-08-10) diff --git a/UI/WebServerResources/js/Mailer/Mailbox.service.js b/UI/WebServerResources/js/Mailer/Mailbox.service.js index 8f0b48e4f..2482f25f0 100644 --- a/UI/WebServerResources/js/Mailer/Mailbox.service.js +++ b/UI/WebServerResources/js/Mailer/Mailbox.service.js @@ -732,10 +732,8 @@ */ Mailbox.prototype.$reset = function() { var _this = this; - angular.forEach(this, function(value, key) { - if (key != 'constructor' && key != 'children' && key[0] != '$') { - delete _this[key]; - } + angular.forEach(this.$shadowData, function(value, key) { + delete _this[key]; }); angular.extend(this, this.$shadowData); this.$shadowData = this.$omit(); @@ -759,6 +757,7 @@ Mailbox.$log.error(JSON.stringify(response.data, undefined, 2)); // Restore previous version _this.$reset(); + return response.data; }); }; @@ -779,7 +778,18 @@ * @return an object literal copy of the Mailbox instance */ Mailbox.prototype.$omit = function() { - return { name: this.name }; + var mailbox = {}; + angular.forEach(this, function(value, key) { + if (key != 'constructor' && + key != 'children' && + key != 'headers' && + key != 'uids' && + key != 'uidsMap' && + key[0] != '$') { + mailbox[key] = value; + } + }); + return mailbox; }; /**