Skip to content

Commit

Permalink
MDL-60029 profile: Replace table alias with non-reserve word
Browse files Browse the repository at this point in the history
* The table alias 'uid' is a reserved word in oracle. Replaced it with
something a little more safe.
  • Loading branch information
junpataleta committed Oct 13, 2017
1 parent 14de134 commit 5a3f03b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions user/profile/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,12 @@ function profile_get_user_fields_with_data($userid) {
// Join any user info data present with each user info field for the user object.
$sql = 'SELECT uif.*, uic.name AS categoryname ';
if ($userid) {
$sql .= ', uid.id AS hasuserdata, uid.data, uid.dataformat ';
$sql .= ', uind.id AS hasuserdata, uind.data, uind.dataformat ';
}
$sql .= 'FROM {user_info_field} uif ';
$sql .= 'LEFT JOIN {user_info_category} uic ON uif.categoryid = uic.id ';
if ($userid) {
$sql .= 'LEFT JOIN {user_info_data} uid ON uif.id = uid.fieldid AND uid.userid = :userid ';
$sql .= 'LEFT JOIN {user_info_data} uind ON uif.id = uind.fieldid AND uind.userid = :userid ';
}
$sql .= 'ORDER BY uic.sortorder ASC, uif.sortorder ASC ';
$fields = $DB->get_records_sql($sql, ['userid' => $userid]);
Expand Down

0 comments on commit 5a3f03b

Please sign in to comment.