Published
Tuesday, March 22, 2011 - 18:44
Written by

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(&#39;version&#39;=&gt; &#39;3.0&#39;, &#39;location_type_id =&gt; 1 etc.);<br />
$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(&#39;version&#39;=&gt;&#39;3&#39;, &#39;contact_id&#39;=&gt; 1);<br />
$result = civicrm_api(&quot;Address&quot;, &quot;Get&quot;, $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!