// Load user-to record.
if ($message->useridto !== $USER->id) {
$userto = core_user::get_user($message->useridto);
+ if ($userto === false) {
+ $userto = core_user::get_noreply_user();
+ }
$tocontact = (array_key_exists($message->useridto, $contacts) and
($contacts[$message->useridto]->blocked == 0) );
$toblocked = (array_key_exists($message->useridto, $contacts) and
// Load user-from record.
if ($message->useridfrom !== $USER->id) {
$userfrom = core_user::get_user($message->useridfrom);
+ if ($userfrom === false) {
+ $userfrom = core_user::get_noreply_user();
+ }
$fromcontact = (array_key_exists($message->useridfrom, $contacts) and
($contacts[$message->useridfrom]->blocked == 0) );
$fromblocked = (array_key_exists($message->useridfrom, $contacts) and
} else {
message_contact_link($user->id, 'block', $return, $script, $includeicontext);
}
- } else { // If not real user, then don't show any links.
+ } else {
+ // If not real user, then don't show any links.
$userpictureparams['link'] = false;
- echo $OUTPUT->user_picture($USER, $userpictureparams);
- echo fullname($user);
+ // Stock profile picture should be displayed.
+ echo $OUTPUT->user_picture($user, $userpictureparams);
}
}