Skip to content
Snippets Groups Projects
Unverified Commit 98507fea authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #18379 from seamuslee001/report_45

report#45 Switch out function call CRM_Utils_Array::value and extend …
parents f412f88c 7538f64d
Branches
Tags
No related merge requests found
......@@ -1223,12 +1223,12 @@ WHERE {$whereClause}";
$clauses[] = '`groups`.parents IS NULL';
}
$savedSearch = CRM_Utils_Array::value('savedSearch', $params);
$savedSearch = $params['savedSearch'] ?? NULL;
if ($savedSearch == 1) {
$clauses[] = 'groups.saved_search_id IS NOT NULL';
$clauses[] = '`groups`.saved_search_id IS NOT NULL';
}
elseif ($savedSearch == 2) {
$clauses[] = 'groups.saved_search_id IS NULL';
$clauses[] = '`groups`.saved_search_id IS NULL';
}
// only show child groups of a specific parent group
......
......@@ -98,7 +98,27 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase {
}
$this->assertEquals(1, $groups['recordsTotal']);
$this->assertEquals('not-me-active', $groups['data'][0]['title']);
// Search on just smart groups keeping the title filter
$_GET['savedSearch'] = 1;
try {
CRM_Group_Page_AJAX::getGroupList();
}
catch (CRM_Core_Exception_PrematureExitException $e) {
$groups = $e->errorData;
}
$this->assertEquals(0, $groups['recordsTotal']);
// Now search on just normal groups keeping the title filter
$_GET['savedSearch'] = 2;
try {
CRM_Group_Page_AJAX::getGroupList();
}
catch (CRM_Core_Exception_PrematureExitException $e) {
$groups = $e->errorData;
}
$this->assertEquals(1, $groups['recordsTotal']);
$this->assertEquals('not-me-active', $groups['data'][0]['title']);
unset($_GET['title']);
unset($_GET['savedSearch']);
// check on status
$_GET['status'] = 2;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment