mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
handled another potential xhtml error: empty select when no members in group.
This commit is contained in:
parent
e91cc88ce3
commit
be833e823c
1 changed files with 6 additions and 3 deletions
|
@ -323,9 +323,12 @@ if ($success) {
|
||||||
if (isset($userids)) { //&& is_array($userids)
|
if (isset($userids)) { //&& is_array($userids)
|
||||||
// Put the groupings into a hash and sort them
|
// Put the groupings into a hash and sort them
|
||||||
$user_names = groups_userids_to_user_names($userids, $courseid);
|
$user_names = groups_userids_to_user_names($userids, $courseid);
|
||||||
|
if(empty($user_names)) {
|
||||||
foreach ($user_names as $user) {
|
echo '<option> </option>';
|
||||||
echo "<option value=\"{$user->id}\">{$user->name}</option>\n";
|
} else {
|
||||||
|
foreach ($user_names as $user) {
|
||||||
|
echo "<option value=\"{$user->id}\">{$user->name}</option>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Print an empty option to avoid the XHTML error of having an empty select element
|
// Print an empty option to avoid the XHTML error of having an empty select element
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue