Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0BFD319EFE for ; Tue, 29 Mar 2016 11:02:26 +0000 (UTC) Received: (qmail 87628 invoked by uid 500); 29 Mar 2016 11:02:25 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 87599 invoked by uid 500); 29 Mar 2016 11:02:25 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 87565 invoked by uid 99); 29 Mar 2016 11:02:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Mar 2016 11:02:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 9EDB72C1F62 for ; Tue, 29 Mar 2016 11:02:25 +0000 (UTC) Date: Tue, 29 Mar 2016 11:02:25 +0000 (UTC) From: =?utf-8?Q?Tobias_M=C3=BCcksch_=28JIRA=29?= To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CB-10976) Can't remove contact field MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-10976?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] Tobias M=C3=BCcksch updated CB-10976: -------------------------------- Description:=20 Let's say a existing contact that I've retrieved from the system has two or= more phone number fields: Shortened version of the contact's object: {code:javascript} navigator.contacts.find(["*"], function (contacts) { var myContact =3D contacts[4]; // Make sure the contact has more th= an two phoneNumberFields delete myContact.phoneNumbers[1]; myContact.save(function () { console.log("Success"); /// You will see, that the contact still has all it's previous = phone numbers }, function () { console.error("error while saving"); }); =20 }, function () { console.error("Could not access conacts."); }); {code} When I remove one of the both contact fields from the phoneNumbers array an= d then save the contact, it still has both numbers on the device. When I re= -retrieve the contact it has both numbers again. (Tested on iOS 9.3 with pl= ugin version 2.0.1) I can't find any hint in the documentation if I do something wrong or if th= e plugin is behaving wrong. *I have created a demo script, which reproduces the issue. You can use it f= or testing:* http://pastebin.com/XRdREL3Y You might want to remove line 25 which removes the contact in the end. This SO Question might be related to the issue: http://stackoverflow.com/qu= estions/35698798/cordova-contacts-plugin-contact-data-is-duplicating-instea= d-of-overwriting-conta?rq=3D1 was: Let's say a existing contact that I've retrieved from the system has two or= more phone number fields: Shortened version of the contact's object: {code:javascript} { phoneNumbers: [{id: 0, type: "work", value: "123123123"}, {id: 1, type: "ho= me", value: "3216532425"}] } {code} When I remove one of the both contact fields from the phoneNumbers array an= d then save the contact, it still has both numbers on the device. When I re= -retrieve the contact it has both numbers again. (Tested on iOS 9.3 with pl= ugin version 2.0.1) I can't find any hint in the documentation if I do something wrong or if th= e plugin is behaving wrong. *I have created a demo script, which reproduces the issue. You can use it f= or testing:* http://pastebin.com/XRdREL3Y You might want to remove line 25 which removes the contact in the end. This SO Question might be related to the issue: http://stackoverflow.com/qu= estions/35698798/cordova-contacts-plugin-contact-data-is-duplicating-instea= d-of-overwriting-conta?rq=3D1 > Can't remove contact field > -------------------------- > > Key: CB-10976 > URL: https://issues.apache.org/jira/browse/CB-10976 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin Contacts > Affects Versions: 2.0.0 > Environment: iOS 9.3 > Reporter: Tobias M=C3=BCcksch > Priority: Blocker > > Let's say a existing contact that I've retrieved from the system has two = or more phone number fields: > Shortened version of the contact's object: > {code:javascript} > navigator.contacts.find(["*"], function (contacts) { > var myContact =3D contacts[4]; // Make sure the contact has more = than two phoneNumberFields > delete myContact.phoneNumbers[1]; > myContact.save(function () { > console.log("Success"); > /// You will see, that the contact still has all it's previou= s phone numbers > }, function () { > console.error("error while saving"); > }); > =20 > }, function () { > console.error("Could not access conacts."); > }); > {code} > When I remove one of the both contact fields from the phoneNumbers array = and then save the contact, it still has both numbers on the device. When I = re-retrieve the contact it has both numbers again. (Tested on iOS 9.3 with = plugin version 2.0.1) > I can't find any hint in the documentation if I do something wrong or if = the plugin is behaving wrong. > *I have created a demo script, which reproduces the issue. You can use it= for testing:* > http://pastebin.com/XRdREL3Y > You might want to remove line 25 which removes the contact in the end. > This SO Question might be related to the issue: http://stackoverflow.com/= questions/35698798/cordova-contacts-plugin-contact-data-is-duplicating-inst= ead-of-overwriting-conta?rq=3D1 -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org