X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FForm%2FRelatedContact.php;h=ec8a205936a4c01becae6ceb4d847c807326ba48;hb=91c0d0d891ebf3174f34feb6983fce71d46542f0;hp=fc0617ab3fd13ee6b2edfc061c244711e8210c9f;hpb=e9ca04da475975a5b3a1f303cf8892d994e24c80;p=civicrm-core.git diff --git a/CRM/Contact/Form/RelatedContact.php b/CRM/Contact/Form/RelatedContact.php index fc0617ab3f..ec8a205936 100644 --- a/CRM/Contact/Form/RelatedContact.php +++ b/CRM/Contact/Form/RelatedContact.php @@ -58,14 +58,14 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { public $_contactId; /** - * form defaults + * Form defaults * * @var array */ protected $_defaults = array(); /** - * build all the data structures needed to build the form + * Build all the data structures needed to build the form * * @return void * @access public @@ -104,7 +104,7 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { } /** - * This function sets the default values for the form. Note that in edit/view mode + * Set default values for the form. Note that in edit/view mode * the default values are retrieved from the database * * @access public @@ -116,7 +116,7 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { } /** - * Function to actually build the form + * Build the form object * * @return void * @access public @@ -181,6 +181,10 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { } $params['contact_type'] = $this->_contactType; + //CRM-14904 + if ( isset($this->_defaults['contact_sub_type']) ) { + $params['contact_sub_type'] = $this->_defaults['contact_sub_type']; + } $params['contact_id'] = $this->_contactId; $contact = CRM_Contact_BAO_Contact::create($params, TRUE);