Skip to content

Commit

Permalink
MDL-77825 grade_gradereport: MS SQL fix for user search
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocolate-lightning committed Apr 3, 2023
1 parent fba0658 commit d017cb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions grade/report/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ public function setup_users() {
// When a user wants to view a particular user rather than a set of users.
// By omission when selecting one user, also allow passing the search value around.
if ($this->userid !== -1) {
$this->userwheresql .= ' AND '.$DB->sql_equal('u.id', ':uid');
$this->userwheresql .= " AND u.id = :uid";
$this->userwheresql_params['uid'] = $this->userid;
}

Expand All @@ -493,7 +493,7 @@ public function setup_users() {
'where' => $keywordswhere,
'params' => $keywordsparams,
] = $this->get_users_search_sql($mappings, (array)$userfields);
$this->userwheresql = " AND $keywordswhere";
$this->userwheresql .= " AND $keywordswhere";
$this->userwheresql_params = array_merge($this->userwheresql_params, $keywordsparams);
}
}
Expand Down

0 comments on commit d017cb5

Please sign in to comment.