Skip to content

Commit

Permalink
MDL-53893 core_badges: Add strictness to manual badge criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
lameze committed Sep 9, 2016
1 parent 0344082 commit 294f777
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions badges/criteria/award_criteria_manual.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,15 @@ public function get_completed_criteria_sql() {
return array($join, $where, $params);
} else {
foreach ($this->params as $param) {
$join .= " LEFT JOIN {badge_manual_award} bma{$param['role']} ON
bma{$param['role']}.recipientid = u.id AND
bma{$param['role']}.issuerrole = :issuerrole{$param['role']} ";
$where .= " AND bma{$param['role']}.issuerrole IS NOT NULL ";
$roledata[] = " bma.issuerrole = :issuerrole{$param['role']} ";
$params["issuerrole{$param['role']}"] = $param['role'];
}
if (!empty($roledata)) {
$extraon = implode(' AND ', $roledata);
$join = " JOIN {badge_manual_award} bma ON bma.recipientid = u.id
AND bma.badgeid = :badgeid{$this->badgeid} AND ({$extraon})";
$params["badgeid{$this->badgeid}"] = $this->badgeid;
}
return array($join, $where, $params);
}
}
Expand Down

0 comments on commit 294f777

Please sign in to comment.