Skip to content

Commit

Permalink
Merge pull request #17622 from seamuslee001/smart_group_error
Browse files Browse the repository at this point in the history
Fix issue with building smart groups when  is empty
  • Loading branch information
seamuslee001 authored Jun 16, 2020
2 parents 4b60f42 + b5da02a commit d819ca1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CRM/Contact/BAO/GroupContactCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,9 @@ public static function load(&$group, $force = FALSE) {
$tempTable = $groupContactsTempTable->getName();
$groupContactsTempTable->createWithColumns('contact_id int, group_id int, UNIQUE UI_contact_group (contact_id,group_id)');

$contactQueries[] = $sql;
if (!empty($sql)) {
$contactQueries[] = $sql;
}
// lets also store the records that are explicitly added to the group
// this allows us to skip the group contact LEFT JOIN
$contactQueries[] =
Expand Down

0 comments on commit d819ca1

Please sign in to comment.