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

Contact.find() docs don't match implementation for zero-length array

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.5.0
    • cordova-js
    • None

    Description

      The docs say:

      http://docs.phonegap.com/en/2.2.0/cordova_contacts_contacts.md.html#contacts.find

      A zero-length contactFields parameter will result in an array of Contact objects with only the id property populated.

      The code says (in contacts.js):

      if (!fields || (utils.isArray(fields) && fields.length === 0)) {
      errorCB && errorCB(new ContactError(ContactError.INVALID_ARGUMENT_ERROR));
      }

      I peeked at the iOS Contacts impl, and I don't think it looks for the case of an empty array.

      Maybe simplest thing is to just make the docs say that an empty array is invalid?

      Attachments

        Activity

          People

            filmaj Filip Maj
            agrieve Andrew Grieve
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: