Skip to content
Snippets Groups Projects
Unverified Commit 2fde1dce authored by Seamus Lee's avatar Seamus Lee Committed by GitHub
Browse files

Merge pull request #20610 from colemanw/fixApiOrder

report#68 Fix smart group crash when ordering by aggregated column
parents 020c9134 3b8b7581
Branches
Tags
No related merge requests found
......@@ -530,6 +530,10 @@ ORDER BY gc.contact_id, g.children
if (empty($apiParams['having'])) {
$apiParams['select'] = array_slice($apiParams['select'], 0, 1);
}
// Order is irrelevant unless using limit or offset
if (empty($apiParams['limit']) && empty($apiParams['offset'])) {
unset($apiParams['orderBy']);
}
/* @var $api \Civi\Api4\Generic\DAOGetAction */
$api = Request::create($savedSearch['api_entity'], 'get', $apiParams);
$query = new Api4SelectQuery($api);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment