CRM-15049: Fixed include/exclude search for parent groups (#10546)
authorahmedg1986 <ahmed@acquaintsoft.com>
Tue, 16 Jan 2018 01:47:34 +0000 (07:17 +0530)
committerEileen McNaughton <eileen@mcnaughty.com>
Tue, 16 Jan 2018 01:47:34 +0000 (14:47 +1300)
* CRM-15049: Fixed include/exclude search for parent groups

* Fixed the style errors

* CRM-15049: update comment

CRM/Contact/Form/Search/Custom/Group.php

index 9637fb6066994e46e433184531e98852b67b1976..3c28ac54826a14d05b193a181940b4d5a7d1d2f7 100644 (file)
@@ -260,6 +260,12 @@ class CRM_Contact_Form_Search_Custom_Group extends CRM_Contact_Form_Search_Custo
       }
       $includedGroups = implode(',', $allGroups);
 
+      //CRM-15049 - Include child group ids.
+      $childGroupIds = CRM_Contact_BAO_Group::getChildGroupIds($this->_includeGroups);
+      if (count($childGroupIds) > 0) {
+        $this->_includeGroups = array_merge($this->_includeGroups, $childGroupIds);
+      }
+
       if (!empty($this->_includeGroups)) {
         $iGroups = implode(',', $this->_includeGroups);
       }