Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-7594

location_update API expects address-array with index 1

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.3.5
    • Fix Version/s: Unscheduled
    • Component/s: CiviCRM API
    • Labels:
      None

      Description

      An array request to civicrm_location_update like
      Array
      (
      [email] => Array
      (
      [0] => Array
      (
      [id] => 15
      [location_type_id] => 1
      [email] => john@doe.com
      [is_primary] => 1
      [on_hold] => 0
      )

      )

      [phone] => Array
      (
      [0] => Array
      (
      [id] => 3
      [location_type_id] => 1
      [phone] => 123456
      [is_primary] => 1
      )

      )

      [address] => Array
      (
      [0] => Array
      (
      [id] => 11
      [location_type_id] => 1
      [street_address] => balbla
      [supplemental_address_1] => C/O addr
      [city] => Stockholm
      [postal_code] => 12345
      [country_id] => 1204
      [is_primary] => 1
      )

      )

      [contact_id] => 13
      [version] => 3.0

      results in an updated email and phone, while the address is not changed:

      Array
      (
      [is_error] => 0
      [result] => Array
      (
      [phone] => Array
      (
      [0] => 3
      )

      [email] => Array
      (
      [0] => 15
      )

      )

      )

      changing the index of the address array from 0 to 1 makes the function working as expected:
      [...]
      [address] => Array
      (
      [1] => Array
      (
      [id] => 11
      [location_type_id] => 1
      [...]

      see also http://forum.civicrm.org/index.php/topic,15352.msg65801.html#msg65801

        Attachments

          Activity

            People

            • Assignee:
              erikhommel Erik Hommel
              Reporter:
              prolineserver Holger Motzkau
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 days
                4d
                Remaining:
                Remaining Estimate - 4 days
                4d
                Logged:
                Time Spent - Not Specified
                Not Specified