From 5737ecffe539d2ae8ecaa969d5f6288af7979f17 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Thu, 28 Jul 2016 18:29:06 +0530 Subject: [PATCH] Additional Fix found during QA --- CRM/Custom/Form/Group.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); } } -- 2.25.1