MDL-74333 badges: Check profile criteria valid when reviewing

This commit is contained in:
Michael Hawkins
2022-05-04 12:58:02 +08:00
committed by Jun Pataleta
parent 34c4b3ce0c
commit 240b402523
+2 -2
View File
@@ -202,8 +202,8 @@ class award_criteria_profile extends award_criteria {
$join .= " LEFT JOIN {user_info_data} uid{$idx} ON uid{$idx}.userid = u.id AND uid{$idx}.fieldid = :fieldid{$idx} ";
$sqlparams["fieldid{$idx}"] = $param['field'];
$whereparts[] = "uid{$idx}.id IS NOT NULL";
} else {
// This is a field from {user} table.
} else if (in_array($param['field'], $this->allowed_default_fields)) {
// This is a valid field from {user} table.
if ($param['field'] == 'picture') {
// The picture field is numeric and requires special handling.
$whereparts[] = "u.{$param['field']} != 0";