mirror of
https://github.com/moodle/moodle.git
synced 2025-01-30 03:58:34 +01:00
Added array check when counting number of groups.
This commit is contained in:
parent
4c906f7388
commit
006e4687cd
@ -92,7 +92,12 @@ function groupWindow(selectgroup) {
|
||||
<?php
|
||||
if (!empty($nonmembers)) {
|
||||
foreach ($nonmembers as $id => $nonmembername) {
|
||||
$numgroups = count(user_group($course->id, $id));
|
||||
if (!is_array($ugroups = user_group($course->id, $id))) {
|
||||
$numgroups = 0;
|
||||
}
|
||||
else {
|
||||
$numgroups = count($ugroups);
|
||||
}
|
||||
echo "<option value=\"$id\" title=\"$nonmembername is in $numgroups groups\">$nonmembername ($numgroups)</option>\n";
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user