From: jitendrapurohit Date: Thu, 28 Jul 2016 12:59:06 +0000 (+0530) Subject: Additional Fix found during QA X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5737ecffe539d2ae8ecaa969d5f6288af7979f17;p=civicrm-core.git Additional Fix found during QA --- diff --git a/CRM/Custom/Form/Group.php b/CRM/Custom/Form/Group.php index 4f733a5869..b981bbaff7 100644 --- a/CRM/Custom/Form/Group.php +++ b/CRM/Custom/Form/Group.php @@ -460,8 +460,12 @@ class CRM_Custom_Form_Group extends CRM_Core_Form { } 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); } }