Skip to content

Commit

Permalink
Fix get_in_or_equal does not accept empty arrays in the Resync users …
Browse files Browse the repository at this point in the history
…in Microsoft 365 groups for courses feature
  • Loading branch information
patmr7 committed Nov 26, 2024
1 parent 8bd25cd commit d4aa6ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion local/o365/classes/page/acp.php
Original file line number Diff line number Diff line change
Expand Up @@ -1432,10 +1432,12 @@ public function mode_maintenance_resyncgroupusers() {
$sql .= ' AND crs.id = ?';
$params[] = $courseid;
}
if (is_array($coursesenabled)) {
if (is_array($coursesenabled) && !empty($coursesenabled)) {
[$coursesinsql, $coursesparams] = $DB->get_in_or_equal($coursesenabled);
$sql .= ' AND crs.id ' . $coursesinsql;
$params = array_merge($params, $coursesparams);
} else {
$sql .= ' AND 1 = 0';
}
$courses = $DB->get_recordset_sql($sql, $params);
$outputsbycourse = [];
Expand Down

0 comments on commit d4aa6ae

Please sign in to comment.