This commit is contained in:
PMKuipers 2024-05-12 23:41:52 +02:00
parent 4c777db678
commit 0ed5007fe5
2 changed files with 5 additions and 2 deletions

View File

@ -149,7 +149,11 @@ class profilehelper {
}
$field->enrolled = in_array($userid,self::enrollable_user_ids())?1:0;
$field->track = self::get_track_identifier($userid);
if ($field->enrolled) {
// Only update the track with the new data if the user is currently enrollable.
// This makes it simpler to create a new track if the track is changed later.
$field->track = self::get_track_identifier($userid);
}
$field->coach = self::get_coach_userid($userid);
if (isset($toolbox)) {

View File

@ -167,7 +167,6 @@ class profilescannertask extends \core\task\scheduled_task {
mtrace("Error retrieving fields for user {$user->username}");
mtrace_exception($x);
}
}
}
}