CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Location API v2.2 no longer supported from 3.4 onwards
Pages: [1]

Author Topic: Location API v2.2 no longer supported from 3.4 onwards  (Read 1145 times)

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Location API v2.2 no longer supported from 3.4 onwards
March 22, 2011, 11:45:13 am
As announced earlier, the Location API has become obsolete in API version 3, which is currently shipped with the 4.0/3.4 alpha versions. It has been replaced by Address, Email, Phone and Website API in v3.

However, in the v2 Location API there was already a param 'version' which was used to determine if the older functionality of the Location API (CiviCRM version 2.2 and older) was used or the newer functionality (CiviCRM 3 and onwards). So the code looked like this:
Code: [Select]
$params = array('version'=> '3.0', 'location_type_id => 1 etc.);
$result = civicrm_location_add($params);

This version param now conflicts with the version parameter introduced in API v3, were we use the version to determine if API v2 or API v3 will be used. So the call will now be something like:
Code: [Select]
$params = array('version'=>'3', 'contact_id'=> 1);
$result = civicrm_api("Address", "Get", $params);
.

So we have  decided to remove the version param used within the v2 Location API. The default behaviour will be the behaviour as if you entered version=>3.0. That means that from CiviCRM 3.4/4.0 onwards you can no longer use the Location API in the CiviCRM 2.2 way.

It is all a bit confusing with the versions, so please let me know if you are not sure what we are on about :-)
Erik
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Location API v2.2 no longer supported from 3.4 onwards

This forum was archived on 2017-11-26.