Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-961

Can not remove contact property values anymore

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.0, 1.6.1, 1.7.0, 1.8.0, 1.8.1, 1.9.0
    • 1.9.0
    • cordova-ios
    • XCode 4, Iphone simulator

    Description

      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

      Attachments

        1. CDVContact.m
          71 kB
          Cyril Joui

        Activity

          People

            becka11y Becky Gibson
            cyril.joui@gmail.com Cyril Joui
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: