// the buildForm adds the contact_sub_type to the form we need to look in _submitValues for it - submitValues
// is a un-sanitised version of what is in the form submission (_POST) whereas `getSubmittedValues()` retrieves
// 'allowed' POSTED values - ie values which match available fields, with some localization handling.
- CRM_Custom_Form_CustomData::preProcess($this, NULL, $this->isSubmitted() ? ($this->_submitValues['contact_sub_type'] ?? []) : $this->getContactValue('contact_sub_type'),
+ CRM_Custom_Form_CustomData::preProcess($this, NULL, $this->isSubmitted() ? ($this->_submitValues['contact_sub_type'] ?? []) : $this->getContactValue('contact_sub_type') ?? $this->_contactSubType,
1, $this->_contactType, $this->getContactID()
);
$this->assign('customValueCount', $this->_customValueCount);