X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FPhone.php;h=e5a4513d4b58bed1f50d96324265a606b854173c;hb=3fe06aa5f4d98f720c452c6e5de07b955b19221b;hp=0ce79c13697a83bd9a1c76ee5c73fc0207049e87;hpb=b48045a740f9b4b47c9f320616baf8ea1f3e2c04;p=civicrm-core.git diff --git a/api/v3/Phone.php b/api/v3/Phone.php index 0ce79c1369..e5a4513d4b 100644 --- a/api/v3/Phone.php +++ b/api/v3/Phone.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2017 | + | Copyright CiviCRM LLC (c) 2004-2019 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -56,6 +56,10 @@ function _civicrm_api3_phone_create_spec(&$params) { $params['phone']['api.required'] = 1; // hopefully change to use handleprimary $params['is_primary']['api.default'] = 0; + $defaultLocation = CRM_Core_BAO_LocationType::getDefault(); + if ($defaultLocation) { + $params['location_type_id']['api.default'] = $defaultLocation->id; + } } /**