-
Bug
-
Resolution: Fixed
-
Minor
-
3.9, 3.10
-
MOODLE_310_STABLE, MOODLE_39_STABLE
-
MOODLE_39_STABLE
-
Hi there,
I am trying to forbid teachers from seeing other participants from other groups. Courses are in force group mode and I am expecting that teachers cannot see any other students other than in their own groups.
Fresh Moodle install version 3.9 (Build: 20200615)
Change Teacher role site:accessallgroups to prohibit
Any course with force group mode on all teachers getting "Error reading from database" once they click Participants button from Moodle menu. follow by redirecting teachers to the front page.
Is it possible to see all participants only in the group they are enrolled in, instead of getting an error?
Debug info: FUNCTION hia_moodle.0AND does not exist
SELECT COUNT(u.id)
FROM (SELECT DISTINCT udistinct.id
FROM mdl_user udistinct
JOIN mdl_user_enrolments ue ON ue.userid = udistinct.id
JOIN mdl_enrol e ON e.id = ue.enrolid
AND e.courseid = ?
WHERE udistinct.deleted = 0
) targetusers
JOIN mdl_user u ON u.id = targetusers.id
JOIN (SELECT DISTINCT feu_u.id
FROM mdl_user feu_u
LEFT JOIN mdl_groups_members gm1_gm2
ON (gm1_gm2.userid = feu_u.id AND gm1_gm2.groupid = ?)
WHERE feu_u.deleted = 0AND (gm1_gm2.userid IS NOT NULL)) fef ON fef.id = u.id
LEFT JOIN (SELECT DISTINCT eu_u.id
FROM mdl_user eu_u
LEFT JOIN mdl_groups_members gm2_gm2
ON (gm2_gm2.userid = eu_u.id AND gm2_gm2.groupid = ?)
WHERE eu_u.deleted = 0 AND ((gm2_gm2.userid IS NOT NULL))) ef ON ef.id = u.id
LEFT JOIN mdl_user_lastaccess ul ON (ul.userid = u.id AND ul.courseid = ?)
LEFT JOIN mdl_context ctx ON (ctx.instanceid = u.id AND ctx.contextlevel = ?)
WHERE ef.id IS NOT NULL
[array (
0 => '35',
1 => 16,
2 => 16,
3 => '35',
4 => 30,
)]
Error code: dmlreadexception
Stack trace:
- line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
- line 1273 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
- line 1624 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
- line 1697 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
- line 1907 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
- line 148 of /user/classes/table/participants_search.php: call to moodle_database->count_records_sql()
- line 407 of /user/classes/table/participants.php: call to core_user\table\participants_search->get_total_participants_count()
- line 2024 of /lib/tablelib.php: call to core_user\table\participants->query_db()
- line 210 of /user/classes/table/participants.php: call to table_sql->out()
- line 181 of /user/index.php: call to core_user\table\participants->out()