-
Bug
-
Resolution: Fixed
-
Major
-
1.9
-
None
-
MOODLE_19_STABLE
-
MOODLE_20_STABLE
The problem is that if these conditions coincide:
1) Default role (eg authenticaled users) has ALLOW permission for a module thing like mod/choice:choose
2) We are checking for that capability in an activity module context in a course (eg a choice activity in a course)
Then we are led inexorably to:
if ($defaultroleinteresting) {
$sql = "SELECT $fields
FROM {$CFG->prefix}user u
$uljoin
$where
ORDER BY $sort";
return get_records_sql($sql, $limitfrom, $limitnum);
}
which can easily return all the site users in one list.
Not only is not accurate (in terms of what the module programmer expected) it can easily surpass the process memory limit for a large site and thus break.
We need to somehow treat this rather common case differently, and just return those people who not only have the capabilty for that activity but also moodle/course:view for the relevant course context.
- blocks
-
CONTRIB-1931 Report + groups not working
-
- Resolved
-
- has been marked as being related by
-
MDL-13478 Choice responses use inefficient SQL causing memory to run out
-
- Closed
-