From d490ca8161efb7b1b27d5d01adb37d4f13d420e4 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Mon, 18 Oct 2010 08:26:57 +0000 Subject: [PATCH] MDL-24690 fixed incorrect cohort condition when auto-creating groups --- group/lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/group/lib.php b/group/lib.php index cdfa2e500e790..8fd4c127e4a80 100644 --- a/group/lib.php +++ b/group/lib.php @@ -542,8 +542,8 @@ function groups_get_potential_members($courseid, $roleid = null, $cohortid = nul } if ($cohortid) { - $cohortjoin = "JOIN {cohort_members} cm ON cm.userid = u.id - JOIN {cohort} c ON c.id = cm.cohortid"; + $cohortjoin = "JOIN {cohort_members} cm ON (cm.userid = u.id AND cm.cohortid = :cohortid)"; + $params['cohortid'] = $cohortid; } else { $cohortjoin = ""; }