From d023b622981cd7fcb3aa3d13b29de9000f987f6e Mon Sep 17 00:00:00 2001 From: madhavimalgaonkar Date: Wed, 12 Sep 2018 17:26:42 +0530 Subject: [PATCH] Updated issue number and grouped if conditions --- CRM/Contact/BAO/Group.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/CRM/Contact/BAO/Group.php b/CRM/Contact/BAO/Group.php index 03b1ac1af4..5b1a4c05dd 100644 --- a/CRM/Contact/BAO/Group.php +++ b/CRM/Contact/BAO/Group.php @@ -350,7 +350,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { CRM_Utils_Hook::pre('create', 'Group', NULL, $params); } - // CRM-287 Disable child groups if all parents are disabled. + // dev/core#287 Disable child groups if all parents are disabled. if(!empty($params['id'])) { $allChildGroupIds = self::getChildGroupIds($params['id']); foreach ($allChildGroupIds as $childKey => $childValue) { @@ -359,10 +359,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { 'id' => ['IN' => $parentIds], 'is_active' => 1, ]); - if (count($parentIds) == 1) { - $setDisable = self::setIsActive($childValue, $params['is_active']); - } - if (count($parentIds) > 1 && $activeParentsCount <= 1) { + if (count($parentIds) == 1 || count($parentIds) > 1 && $activeParentsCount <= 1) { $setDisable = self::setIsActive($childValue, $params['is_active']); } } -- 2.25.1