Merge pull request #15666 from revati90/shared_address
[civicrm-core.git] / api / v3 / Address.php
index 05586e2c37ddd429f2ec1216bc8725c75dc4feb7..a9bd0e0c88f7be364632fd37edcbb0c23d6edd73 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019                                |
+ | Copyright CiviCRM LLC (c) 2004-2020                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -125,6 +125,10 @@ function _civicrm_api3_address_create_spec(&$params) {
     'name' => 'world_region',
     'type' => CRM_Utils_Type::T_TEXT,
   ];
+  $defaultLocation = CRM_Core_BAO_LocationType::getDefault();
+  if ($defaultLocation) {
+    $params['location_type_id']['api.default'] = $defaultLocation->id;
+  }
 }
 
 /**