Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

Commit

Permalink
MDL-46833 mod_assign: Fix assignment view when available for group me…
Browse files Browse the repository at this point in the history
…mbers 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.
  • Loading branch information
kabalin committed Aug 14, 2014
1 parent e1eb180 commit dfaedf0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/grouplib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit dfaedf0

Please sign in to comment.