Merge pull request #814 from eileenmcnaughton/CRM-12642
[civicrm-core.git] / api / v3 / LocBlock.php
index 77f0e5d5746b2eb278007cddb88616466275dcfa..85b4f2822d3f902925715fb0d403a1387b5419fb 100644 (file)
@@ -63,7 +63,7 @@ function civicrm_api3_loc_block_create($params) {
         }
         // Bother calling the api
         else {
-          $info['version'] = 3;
+          $info['version'] = $params['version'];
           $info['contact_id'] = CRM_Utils_Array::value('contact_id', $info, 'null');
           $result = civicrm_api($item, 'create', $info);
           if (!empty($result['is_error'])) {
@@ -101,6 +101,7 @@ function civicrm_api3_loc_block_get($params) {
   // If a return param has been set then fetch the appropriate fk objects
   // This is a helper because api chaining does not work with a key like 'email_2'
   if (!empty($options['return'])) {
+    unset($params['return']);
     $values = array();
     $items = array('address', 'email', 'phone', 'im');
     $returnAll = !empty($options['return']['all']);