moodle 1.9.8 using mysql external database
Tracked down to moodle/lib/accesslib.php calling function groups_delete_group_members($context->instanceid, $ra->userid); then DELETE FROM mdl_groups_members WHERE groupid IN (SELECT id FROM mdl_groups g WHERE g.courseid = 13072) AND userid = 65635
apparently user lost capabilities 'moodle/course:view' for the course.
Why it lost capabilities if user in the external database for the course and the instructor has not removed him from course ?
Thanks