summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2011-05-14 13:29:17 -0400
committerDries Buytaert <dries@buytaert.net>2011-05-14 13:29:17 -0400
commit2646b43acdd3cf1e11319d8ea5bec01d9eaac2a2 (patch)
treec7d87ed0ffef428bb583de65c10647c3901cb336 /modules/comment/comment.module
parent0b007f5413c990686e648aab3919e8fc94d67de1 (diff)
downloadbrdo-2646b43acdd3cf1e11319d8ea5bec01d9eaac2a2.tar.gz
brdo-2646b43acdd3cf1e11319d8ea5bec01d9eaac2a2.tar.bz2
- Patch #1149912 by grendzy, sun: recent comments block displays old, out-of-order comments.
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module6
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 5526bebe9..836f2fed8 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -494,6 +494,7 @@ function comment_permalink($cid) {
*
* @param integer $number
* (optional) The maximum number of comments to find. Defaults to 10.
+ *
* @return
* An array of comment objects or an empty array if there are no recent
* comments visible to the current user.
@@ -501,15 +502,12 @@ function comment_permalink($cid) {
function comment_get_recent($number = 10) {
$query = db_select('comment', 'c');
$query->innerJoin('node', 'n', 'n.nid = c.nid');
- $query->innerJoin('node_comment_statistics', 'ncs', 'ncs.nid = c.nid');
$query->addTag('node_access');
$comments = $query
->fields('c')
- ->condition('ncs.comment_count', 0, '>')
->condition('c.status', COMMENT_PUBLISHED)
->condition('n.status', NODE_PUBLISHED)
- ->orderBy('ncs.last_comment_timestamp', 'DESC')
- ->orderBy('c.cid', 'DESC')
+ ->orderBy('c.created', 'DESC')
->range(0, $number)
->execute()
->fetchAll();