}
if (!empty($this->_subtypes)) {
- $subtypesToBeRemoved = array_diff($this->_subtypes, array_intersect($this->_subtypes, $params['extends'][1]));
+ $subtypesToBeRemoved = array();
$subtypesToPreserve = $params['extends'][1];
+ // Don't remove any value if group is extended to -any- subtype
+ if (!empty(current($subtypesToPreserve))) {
+ $subtypesToBeRemoved = array_diff($this->_subtypes, array_intersect($this->_subtypes, $subtypesToPreserve));
+ }
CRM_Contact_BAO_ContactType::deleteCustomRowsOfSubtype($this->_id, $subtypesToBeRemoved, $subtypesToPreserve);
}
}