Location API v2.2 no longer supported from 3.4 onwards

Published
2011-03-22 18:44
Written by
kurund - member of the CiviCRM community - view blog guidelines

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:

 

$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:

 

$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.

 

Repost from: http://forum.civicrm.org/index.php/topic,19157.0.html

 

Filed under

Comments

Good to know,

 

The location API was too much of a monster anyways, the version => '3.0' always confused me for whying it was being there.

 

Good job guys!