MDL-35788 mod_forum: Move post creation fetch

This commit is contained in:
Andrew Nicols 2018-10-04 08:56:15 +08:00
parent 424920f8fb
commit 94df729b92

View File

@ -2659,7 +2659,7 @@ function forum_get_discussions($cm, $forumsort="", $fullpost=true, $unused=-1, $
$forumsort = forum_get_default_sort_order();
}
if (empty($fullpost)) {
$postdata = "p.id,p.subject,p.modified,p.discussion,p.userid";
$postdata = "p.id, p.subject, p.modified, p.discussion, p.userid, p.created";
} else {
$postdata = "p.*";
}
@ -2680,7 +2680,7 @@ function forum_get_discussions($cm, $forumsort="", $fullpost=true, $unused=-1, $
}
$allnames = get_all_user_name_fields(true, 'u');
$sql = "SELECT $postdata, d.name, d.timemodified, d.usermodified, d.groupid, d.timestart, d.timeend, d.pinned, p.created,
$sql = "SELECT $postdata, d.name, d.timemodified, d.usermodified, d.groupid, d.timestart, d.timeend, d.pinned,
$allnames, u.email, u.picture, u.imagealt $umfields
FROM {forum_discussions} d
JOIN {forum_posts} p ON p.discussion = d.id