Skip to content

Commit

Permalink
Fix #796 - fix sql query when custom fields included.
Browse files Browse the repository at this point in the history
  • Loading branch information
danmarsden committed Dec 20, 2024
1 parent 8f3a2db commit 43dcc04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions absentee.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@
if (!empty($CFG->showuseridentity) && has_capability('moodle/site:viewuseridentity', $context)) {
$extrafields = explode(',', $CFG->showuseridentity);
foreach ($extrafields as $field) {
$columns[] = $field;
$headers[] = get_string($field);
if (strpos($field, 'profile_field') !== 0) {
$columns[] = $field;
$headers[] = get_string($field);
}
}
}
$columns = array_merge($columns, ['numtakensessions', 'percent', 'timesent']);
Expand Down
6 changes: 4 additions & 2 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1109,8 +1109,10 @@ function attendance_get_users_to_notify($courseids = [], $orderby = '', $allforn
if (!empty($CFG->showuseridentity)) {
$extrafields = explode(',', $CFG->showuseridentity);
foreach ($extrafields as $field) {
$unames .= $field . ', ';
$unames2 .= 'u.' . $field . ', ';
if (strpos($field, 'profile_field') !== 0) {
$unames .= $field . ', ';
$unames2 .= 'u.' . $field . ', ';
}
}
}

Expand Down

0 comments on commit 43dcc04

Please sign in to comment.