MDL-52576 forum: fix user profile picture in external service

This commit is contained in:
Ben Kelada 2015-12-22 08:37:02 +11:00
parent ef343c3299
commit 14ebc39645

View File

@ -478,15 +478,15 @@ class mod_forum_external extends external_api {
$post->children = array();
}
$userpicture = new user_picture($post);
$userpicture->size = 1; // Size f1.
$post->userpictureurl = $userpicture->get_url($PAGE)->out(false);
$user = new stdclass();
$user->id = $post->userid;
$user = username_load_fields_from_object($user, $post);
$user = username_load_fields_from_object($user, $post, null, array('picture', 'imagealt', 'email'));
$post->userfullname = fullname($user, $canviewfullname);
$userpicture = new user_picture($user);
$userpicture->size = 1; // Size f1.
$post->userpictureurl = $userpicture->get_url($PAGE)->out(false);
// Rewrite embedded images URLs.
list($post->message, $post->messageformat) =
external_format_text($post->message, $post->messageformat, $modcontext->id, 'mod_forum', 'post', $post->id);