Permalink
Browse files

Merge branch 'MDL-37628-23' of git://github.com/grabs/moodle into MOO…

…DLE_23_STABLE
  • Loading branch information...
2 parents a83ce21 + 7fdb36f commit 7ec3fd667ae987eefcb1ee6e1c5fcdd7386ac33a Sam Hemelryk committed Jan 28, 2013
Showing with 15 additions and 4 deletions.
  1. +15 −4 mod/feedback/lib.php
View
@@ -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}&amp;course=$courseid\">"
+ echo "<a href=\"$CFG->wwwroot/user/view.php?id={$activity->user->id}&amp;course=$courseid\">"
."{$activity->user->fullname}</a> - ".userdate($activity->timestamp);
echo '</div>';

0 comments on commit 7ec3fd6

Please sign in to comment.