Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSH-492 Fix cohort-enrol course cohort sync #493

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Moosh/Command/Moodle39/Cohort/CohortEnrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ public function execute()

foreach($cohorts as $cohort) {

// Check if cohort enrolment already exists
if ($cohortenrolment = $DB->get_record('enrol',array('customint1'=>$cohort->id,'courseid'=>$options['courseid'],'roleid'=>$role->id))) {
// Check if cohort enrolment already exists.
if ($cohortenrolment = $DB->get_record('enrol', ['enrol' => 'cohort', 'customint1' => $cohort->id,
'courseid' => $options['courseid'], 'roleid' => $role->id])) {
echo " Notice: Cohort already enrolled into course\n";
} else {

Expand Down Expand Up @@ -135,4 +136,4 @@ protected function build_sync_name($pattern, $cohort, $role)

return $pattern;
}
}
}
Loading