Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 326019E95 for ; Thu, 28 Jun 2012 12:57:48 +0000 (UTC) Received: (qmail 23635 invoked by uid 500); 28 Jun 2012 12:57:48 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 21794 invoked by uid 500); 28 Jun 2012 12:57:45 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 20943 invoked by uid 99); 28 Jun 2012 12:57:44 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2012 12:57:44 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 0713C141BDA for ; Thu, 28 Jun 2012 12:57:44 +0000 (UTC) Date: Thu, 28 Jun 2012 12:57:44 +0000 (UTC) From: "Becky Gibson (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <1375706270.66459.1340888264034.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1651105431.58009.1340739103914.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (CB-961) Can not remove contact property values anymore MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13403071#comment-13403071 ] Becky Gibson commented on CB-961: --------------------------------- Right, but I don't call setMultiValueStrings for organization since it isn't a multiValue on the iOS side. Right now in order to delete an organization you need to set each field in the ContactOrganization object to an empty string rather than setting Contact.organizations to an empty array. Will file a ticket for that. At least I remember why I made the change (even if it was wrong :). At one point the unified JS was initializing the arrays in the Contact object to an empty array rather than null. I made this change to get things working with an empty array as the default and obviously didn't test enough or change it back when the default values got set back to null! > Can not remove contact property values anymore > ---------------------------------------------- > > Key: CB-961 > URL: https://issues.apache.org/jira/browse/CB-961 > Project: Apache Cordova > Issue Type: Bug > Components: iOS > Affects Versions: 1.6.0, 1.6.1, 1.7.0, 1.8.0, 1.8.1, 1.9.0 > Environment: XCode 4, Iphone simulator > Reporter: Cyril Joui > Assignee: Becky Gibson > Labels: patch > Attachments: CDVContact.m > > > We can not remove property values of a contact anymore (since cordova > 1.5.0). > Comment in CDVContact.m (source from 1.7.0 tag): > > > /* Set MultiValue string properties into Address Book Record. > * NSArray* fieldArray - array of dictionaries containing W3C properties to be set into record > * ABPropertyID prop - the property to be set (generally used for phones and emails) > * ABRecordRef person - the record to set values into > * BOOL bUpdate - whether or not to update date or set as new. > * When updating: > * emtpy array indicates to remove entire property > * empty string indicates to remove > * [NSNull null] do not modify (keep existing record value) > * RETURNS > * bool false indicates error > * > * used for phones and emails > */ > -(bool) setMultiValueStrings: (NSArray*)fieldArray forProperty: (ABPropertyID) prop inRecord: (ABRecordRef)person asUpdate: (BOOL)bUpdate > { > < > === > * When updating: > * emtpy array indicates to remove entire property > * empty string indicates to remove > === > fieldArray is never empty because of checking is count in method: > > > -(bool) setFromContactDict:(NSMutableDictionary*) aContact asUpdate: (BOOL) bUpdate > < > > > if ([array isKindOfClass:[NSArray class]] && [array count] > 0){ > < > I propose to remove the && [array count] for: > - phoneNumbers > - emails > - ims > - addresses -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira