X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FForm%2FContact.php;h=4d30d0c01988c7d3253e772edcfcb339d5c7c5a6;hb=ea3ddccf2929c9778e4443ecd039c02a0a957dd8;hp=be31f190e36f27c959fb704b20f30d8de66c2a10;hpb=db2e53c6f9a5c31b665c7de2f8416eaff945734c;p=civicrm-core.git diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index be31f190e3..4d30d0c019 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -464,8 +464,9 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { } /** - * Do the set default related to location type id, - * primary location, default country + * Do the set default related to location type id, primary location, default country. + * + * @param array $defaults */ public function blockSetDefaults(&$defaults) { $locationTypeKeys = array_filter(array_keys(CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id')), 'is_int'); @@ -975,6 +976,18 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { $parseStatusMsg = self::parseAddressStatusMsg($parseResult); } + $blocks = array('email', 'phone', 'im', 'openid', 'address', 'website'); + foreach ($blocks as $block) { + if (!empty($this->_preEditValues[$block]) && is_array($this->_preEditValues[$block])) { + foreach ($this->_preEditValues[$block] as $count => $value) { + if (!empty($value['id'])) { + $params[$block][$count]['id'] = $value['id']; + $params[$block]['isIdSet'] = TRUE; + } + } + } + } + // Allow un-setting of location info, CRM-5969 $params['updateBlankLocInfo'] = TRUE;