Skip to content

Commit

Permalink
Merge pull request #189 from sameer-ah/language-filter-fix
Browse files Browse the repository at this point in the history
User Profile Fields Language Filter Fix
  • Loading branch information
jleyva authored Oct 3, 2024
2 parents 133a93c + a46406c commit a98f23f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/filters/fuserfield/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function definition(): void {

if ($profile = $remotedb->get_records('user_info_field')) {
foreach ($profile as $p) {
$usercolumns['profile_' . $p->shortname] = $p->name;
$usercolumns['profile_' . $p->shortname] = format_string($p->name);
}
}

Expand Down
4 changes: 2 additions & 2 deletions components/filters/fuserfield/plugin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,15 @@ public function print_filter(MoodleQuickForm $mform, $formdata = false): void {
if (strpos($formdata->field, 'profile_') === 0) {
$conditions = ['shortname' => str_replace('profile_', '', $formdata->field)];
if ($field = $remotedb->get_record('user_info_field', $conditions)) {
$selectname = $field->name;
$selectname = format_string($field->name);
[$usql, $params] = $remotedb->get_in_or_equal($userlist);
$sql = "SELECT DISTINCT(data) as data FROM {user_info_data} WHERE fieldid = ? AND userid $usql";
$params = array_merge([$field->id], $params);

if ($infodata = $remotedb->get_records_sql($sql, $params)) {
$finalusersid = [];
foreach ($infodata as $d) {
$filteroptions[base64_encode($d->data)] = $d->data;
$filteroptions[base64_encode(format_string($d->data))] = format_string($d->data);
}
}
}
Expand Down

0 comments on commit a98f23f

Please sign in to comment.