MDL-35788 mod_forum: Move post creation fetch
authorAndrew Nicols <andrew@nicols.co.uk>
Thu, 4 Oct 2018 00:56:15 +0000 (08:56 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Thu, 4 Oct 2018 03:15:17 +0000 (11:15 +0800)
mod/forum/lib.php

index 4101f15..0d1bb37 100644 (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