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

State not saving using API or Profiles

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.4
    • Labels:
      None

      Description

      Using the same code in Drupal, this worked in revision 4495, but not in 4543. The state_province_id field in the civicrm_address table is being marked as null if previously blank or unchanged if it was not null.

      Code snippet:

      if (function_exists('civicrm_initialize')) {
      civicrm_initialize(TRUE);
      $params = array('email' => 'rich@strangebirdlabs.com');
      if ($contact = crm_get_contact($params))

      { $info = array('first_name' => 'Rich', 'last_name' => 'Orris', 'street_address' => '123 Main Street', 'city' => 'San Francisco', 'state_province' => 'CA', 'postal_code' => '94111', 'phone' => '(555) 555-5555'); $contact = crm_update_contact($contact, $info); }

      }

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              rorris Richard Orris
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: