cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Mücksch (JIRA) <>
Subject [jira] [Reopened] (CB-10976) Can't remove phonenumber field from contact
Date Tue, 12 Apr 2016 07:09:25 GMT


Tobias Mücksch reopened CB-10976:

Thank you for your effort!

In your *additional note* you suggest to create new arrays instead of the delete operator.
But then the contact's phonenumbers (or any other detail) are duplicated. The problem is,
that the "old" numbers are kept.

I fully understand the *solution provided*. But I'm not really satisfied. This only feels
like a quick-and-dirty work-around. You are taking the U out of the CRUD -> CRD. Well then
why aren't you consequent? What is the point in offering a save function for updating existing
contacts anyways?

I can't think of any framework that offers models, where I can't update the models, but have
to remove them and then re-create.

> Can't remove phonenumber field from contact
> -------------------------------------------
>                 Key: CB-10976
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Contacts
>    Affects Versions: 2.0.0
>         Environment: iOS 9.3
>            Reporter: Tobias Mücksch
>            Assignee: Sarangan Rajamanickam
>              Labels: iOS, triaged
> Short demo script:
> {code:javascript}
>     navigator.contacts.find(["*"], function (contacts) {
>         // Pick a contact
>         // (Make sure the contact has more than two phoneNumberFields)
>         var myContact = contacts[4]; 
>         // Remove the second phone number
>         delete myContact.phoneNumbers[1];
> () {
>             console.log("Success");
>             /// You will see, that the contact still has all it's previous phone numbers
>         }, function () {
>             console.error("error while saving");
>         });
>     }, function () {
>         console.error("Could not access conacts.");
>     });
> {code}
> Let's say a existing contact that I've retrieved from the system has two or more phone
number fields. When I remove one of the both contact fields from the phoneNumbers array and
then save the contact, *it still has all 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:
> You might want to remove line 25 which removes the contact in the end.
> This SO Question might be related to the issue:

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message