Additional Fix found during QA
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 28 Jul 2016 12:59:06 +0000 (18:29 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 28 Jul 2016 13:04:03 +0000 (18:34 +0530)
CRM/Custom/Form/Group.php

index 4f733a5869f3d9051d0fc69b901a222b3fdd1bae..b981bbaff74ad135a1f548df760578ca21eb0084 100644 (file)
@@ -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);
       }
     }