mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-46833 mod_assign: Fix assignment view when available for group members only.
When assignment is "Available for group members only" and no users with mod/assign:submit role permision is enrolled (students), groups_filter_users_by_course_module_visible is causing error (as $users array is empty). The patch resolves the issue.
This commit is contained in:
parent
e95c5eed2c
commit
61560c2b72
1 changed files with 3 additions and 0 deletions
|
@ -860,6 +860,9 @@ function groups_get_activity_allowed_groups($cm,$userid=0) {
|
|||
function groups_filter_users_by_course_module_visible($cm, $users) {
|
||||
global $CFG, $DB;
|
||||
|
||||
if (empty($users)) {
|
||||
return $users;
|
||||
}
|
||||
if (empty($CFG->enablegroupmembersonly)) {
|
||||
return $users;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue