mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
MDL-37628 feedback - Coding error in Recent Activity
This commit is contained in:
parent
b3778a0dec
commit
82e4dc33f0
@ -453,13 +453,24 @@ function feedback_get_recent_mod_activity(&$activities, &$index,
|
||||
$tmpactivity->sectionnum= $cm->sectionnum;
|
||||
$tmpactivity->timestamp = $feedbackitem->timemodified;
|
||||
|
||||
$tmpactivity->content = new stdClass();
|
||||
$tmpactivity->content->feedbackid = $feedbackitem->id;
|
||||
$tmpactivity->content->feedbackuserid = $feedbackitem->userid;
|
||||
|
||||
//TODO: add all necessary user fields, this is not enough for user_picture
|
||||
$tmpactivity->user->userid = $feedbackitem->userid;
|
||||
$userfields = explode(',', user_picture::fields());
|
||||
$tmpactivity->user = new stdClass();
|
||||
foreach ($userfields as $userfield) {
|
||||
if ($userfield == 'id') {
|
||||
$tmpactivity->user->{$userfield} = $feedbackitem->userid; // aliased in SQL above
|
||||
} else {
|
||||
if (!empty($feedbackitem->{$userfield})) {
|
||||
$tmpactivity->user->{$userfield} = $feedbackitem->{$userfield};
|
||||
} else {
|
||||
$tmpactivity->user->{$userfield} = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
$tmpactivity->user->fullname = fullname($feedbackitem, $viewfullnames);
|
||||
$tmpactivity->user->picture = $feedbackitem->picture;
|
||||
|
||||
$activities[$index++] = $tmpactivity;
|
||||
}
|
||||
@ -500,7 +511,7 @@ function feedback_print_recent_mod_activity($activity, $courseid, $detail, $modn
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="user">';
|
||||
echo "<a href=\"$CFG->wwwroot/user/view.php?id={$activity->user->userid}&course=$courseid\">"
|
||||
echo "<a href=\"$CFG->wwwroot/user/view.php?id={$activity->user->id}&course=$courseid\">"
|
||||
."{$activity->user->fullname}</a> - ".userdate($activity->timestamp);
|
||||
echo '</div>';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user