CRM_Core_DAO::executeQuery("INSERT IGNORE INTO $tempTable (group_id, contact_id) {$contactQuery}");
}
+ CRM_Core_DAO::reenableFullGroupByMode();
+
if ($group->children) {
// Store a list of contacts who are removed from the parent group
$currentModes = array_fill_keys(CRM_Utils_SQL::getSqlModes(), 1);
$currentModes = array_merge($currentModes, array_fill_keys($modes, 1));
CRM_Core_DAO::executeQuery("SET GLOBAL sql_mode = '" . implode(',', array_keys($currentModes)) . "'");
+ CRM_Core_DAO::executeQuery("SET sql_mode = '" . implode(',', array_keys($currentModes)) . "'");
}
}