Skip to content

Commit

Permalink
MDL-11525 When courseid is not present in the log entry, showing "Sit…
Browse files Browse the repository at this point in the history
…e" instead of $log->info
  • Loading branch information
nicolasconnault committed Oct 5, 2007
1 parent 2cc649e commit 05a3343
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions course/lib.php
Expand Up @@ -404,13 +404,14 @@ function build_logs_array($course, $user=0, $date=0, $order="l.time ASC", $limit
}
}


/// Getting all members of a group.
if ($groupid and !$user) {
if ($gusers = groups_get_members($groupid)) {
$gusers = array_keys($gusers);
$joins[] = 'l.userid IN (' . implode(',', $gusers) . ')';
} else {
$joins[] = 'l.userid = 0'; // No users in groups, so we want something that will always by false.
$joins[] = 'l.userid = 0'; // No users in groups, so we want something that will always be false.
}
}
else if ($user) {
Expand Down Expand Up @@ -520,7 +521,7 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per
if ($course->id == SITEID) {
echo "<td class=\"cell c0\">\n";
if (empty($log->course)) {
echo format_string($log->info)."\n";
echo get_string('site') . "\n";
} else {
echo " <a href=\"{$CFG->wwwroot}/course/view.php?id={$log->course}\">". format_string($courses[$log->course])."</a>\n";
}
Expand Down Expand Up @@ -2921,4 +2922,4 @@ function update_course($data) {
return false;
}

?>
?>

0 comments on commit 05a3343

Please sign in to comment.