diff --git a/NEWS b/NEWS index 1331c5bf2..e480e4fd7 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ Bug fixes - [web] fixed confusion between owner and active user in ACLs management of Administration module + - [web] fixed JavaScript exception after renaming an address book 3.2.4 (2016-12-01) ------------------ diff --git a/UI/WebServerResources/js/Contacts/AddressBook.service.js b/UI/WebServerResources/js/Contacts/AddressBook.service.js index 1d9719ab3..e59670bba 100644 --- a/UI/WebServerResources/js/Contacts/AddressBook.service.js +++ b/UI/WebServerResources/js/Contacts/AddressBook.service.js @@ -583,10 +583,14 @@ * @returns a promise of the HTTP operation */ AddressBook.prototype.$rename = function(name) { - var i = _.indexOf(_.map(AddressBook.$addressbooks, 'id'), this.id); + var i, list; + + list = this.isSubscription? AddressBook.$subscriptions : AddressBook.$addressbooks; + i = _.indexOf(_.map(list, 'id'), this.id); this.name = name; - AddressBook.$addressbooks.splice(i, 1); + list.splice(i, 1); AddressBook.$add(this); + return this.$save(); }; @@ -848,7 +852,10 @@ var addressbook = {}; angular.forEach(this, function(value, key) { if (key != 'constructor' && + key != 'acls' && key != 'ids' && + key != 'idsMap' && + key != 'urls' && key[0] != '$') { addressbook[key] = value; }