By checking if contact_type is empty
$this->normalizeDefaultValues($defaults);
//991/Subtypes not respected when editing smart group criteria
- if ($defaults['contact_type'] && !empty($this->_formValues['contact_sub_type'])) {
+ if (!empty($defaults['contact_type']) && !empty($this->_formValues['contact_sub_type'])) {
foreach ($this->_formValues['contact_sub_type'] as $subtype) {
$basicType = CRM_Contact_BAO_ContactType::getBasicType($subtype);
$defaults['contact_type'][$subtype] = $basicType . '__' . $subtype;