Skip to content

Commit

Permalink
Merge branch 'wip-99579-m403' into MOODLE_403_STABLE
Browse files Browse the repository at this point in the history
  • Loading branch information
weilai-irl committed Apr 12, 2024
2 parents c7d0890 + 4643d98 commit 7e4b89a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion local/o365/classes/feature/coursesync/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,10 @@ public static function sync_user_role_in_course_group(int $userid, int $courseid
break;
case MICROSOFT365_GROUP_ROLE_MEMBER:
// Add user to the Microsoft 365 group as member.
$coursesync->remove_owner_from_group($groupobjectid, $userobjectid);
$groupowneroids = $coursesync->get_group_owners($groupobjectid);
if (in_array($userobjectid, $groupowneroids)) {
$coursesync->remove_owner_from_group($groupobjectid, $userobjectid);
}
$coursesync->add_member_to_group($groupobjectid, $userobjectid);
break;
}
Expand Down

0 comments on commit 7e4b89a

Please sign in to comment.