[
https://issues.apache.org/jira/browse/CB-961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13402901#comment-13402901
]
Cyril Joui commented on CB-961:
-------------------------------
Hi!
I think you've done this case for
- "organizations" (see comment: 'iOS only supports one organization - use
first one')
You check array count > 0 in setMultiValueStrings: ' else if (bUpdate &&
[fieldArray count] == 0) '
You should find your GIT commit comment between 1.5.0 and 1.6.0 cordova version
... (if it's possible lol).
In my view, having an empty array to remove all property values sounds good!
The other solution could be having a custom value to empty property (like
"NONE" or "REMOVE" or something else: explicit remove command).
Or finally, it could be a removePropertyValues (property name) method in
Contact?
Hope it will help!
> 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