Skip to content

Commit

Permalink
handled another potential xhtml error: empty select when no members i…
Browse files Browse the repository at this point in the history
…n group.
  • Loading branch information
nicolasconnault committed Mar 30, 2007
1 parent 60b6fc1 commit b608d7c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions group/index.php
Expand Up @@ -323,9 +323,12 @@
if (isset($userids)) { //&& is_array($userids)
// Put the groupings into a hash and sort them
$user_names = groups_userids_to_user_names($userids, $courseid);

foreach ($user_names as $user) {
echo "<option value=\"{$user->id}\">{$user->name}</option>\n";
if(empty($user_names)) {
echo '<option>&nbsp;</option>';
} else {
foreach ($user_names as $user) {
echo "<option value=\"{$user->id}\">{$user->name}</option>\n";
}
}
} else {
// Print an empty option to avoid the XHTML error of having an empty select element
Expand Down

0 comments on commit b608d7c

Please sign in to comment.