Details
-
Type:
Bug
-
Status: Peer review in progress
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 3.5.12, 3.6.10, 3.7.6, 3.8.3, 3.9, 3.10.1, 3.11
-
Fix Version/s: None
-
Component/s: Badges
-
Testing Instructions:
-
Affected Branches:MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
Pull from Repository:
-
Pull 3.9 Branch:MDL-69102-39
-
Pull 3.10 Branch:MDL-69102-310
-
Pull 3.11 Branch:MDL-69102-311
-
Pull Master Branch:MDL-69102-master
-
Pull Master Diff URL:
Description
The code to award a badge when the criteria requires being a member of multiple cohorts is broken.
It appears that the WHERE clause that's generated when seeing if a person is a member of ALL required cohorts doesn't work.
In criteria/award_criteria_cohort line 247ish reads:
$where = ' AND cm.cohortid = :cohortid'.$i;
When I believe it should read:
$where .= ' AND cm.cohortid = :cohortid'.$i;
So a person could gain the badge if they were only a member of the last cohort, not all cohorts, because the AND clause only includes the last cohortid.
I was looking at MDL-63120 and ran across this line, which I'm pretty sure is just a simple oversight bug, but I'm definitely not a) a php programmer or b) overly familiar with the cohort award code.