CRM-18528 Manage Groups search ignores filters
authorkenwest <ken.west@internode.on.net>
Sat, 14 May 2016 12:17:23 +0000 (22:17 +1000)
committerkenwest <ken.west@internode.on.net>
Sat, 14 May 2016 12:17:23 +0000 (22:17 +1000)
CRM/Group/Page/AJAX.php

index c1e65816356bae682502c45e2e77b4366fe6f361..86dedb3639fd3a483c38f63fbfb06e9901ba6ebe 100644 (file)
@@ -50,13 +50,19 @@ class CRM_Group_Page_AJAX {
       CRM_Utils_JSON::output($groups);
     }
     else {
-      $params = CRM_Core_Page_AJAX::defaultSortAndPagerParams();
-
-      $optionalParameters = array(
+      $requiredParams = array();
+      $optionalParams = array(
+        'title' => 'String',
+        'created_by' => 'String',
+        'group_type' => 'String',
+        'visibility' => 'String',
+        'status' => 'Integer',
         'parentsOnly' => 'Integer',
         'showOrgInfo' => 'Boolean',
+        // Ignore 'parent_id' as that case is handled above
       );
-      $params += CRM_Core_Page_AJAX::validateParams(array(), $optionalParameters);
+      $params = CRM_Core_Page_AJAX::defaultSortAndPagerParams();
+      $params += CRM_Core_Page_AJAX::validateParams($requiredParams, $optionalParams);
 
       // get group list
       $groups = CRM_Contact_BAO_Group::getGroupListSelector($params);