Let me explain by example, suppose we have forum id 2000 and set default sort by desc with order by last_comment_timestamp

Sample forum topic:

nid, title, created, changed, last_reply, last_comment_timestamp
100, Topic A, 1 Jan 2012, 1 Jan 2012, 2 Jan 2012, 2 Jan 2012
101, Topic B, 2 Jan 2012, 2 Jan 2012, none, 2 Jan 2012
102, Topic C, 3 Jan 2012, 3 Jan 2012, none, 3 Jan 2012

Current order in forum/2000 (which is not as I wish):

nid, title, created, changed, last_reply, last_comment_timestamp
102, Topic C, 3 Jan 2012, 3 Jan 2012, none, 3 Jan 2012
101, Topic B, 2 Jan 2012, 2 Jan 2012, none, 2 Jan 2012
100, Topic A, 1 Jan 2012, 1 Jan 2012, 2 Jan 2012, 2 Jan 2012

Expect:

nid, title, created, changed, last_reply, last_comment_timestamp
100, Topic A, 1 Jan 2012, 1 Jan 2012, 2 Jan 2012, 2 Jan 2012
102, Topic C, 3 Jan 2012, 3 Jan 2012, none, 3 Jan 2012
101, Topic B, 2 Jan 2012, 2 Jan 2012, none, 2 Jan 2012

The field "last_comment_timestamp" should not be used if there's no comment on that topic,
so I've made my own patch as attached, the patch fix SQL to count and order only the node that has comments.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

noomz’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, forum-topic-order-last-comment-timestamp.patch, failed testing.

larowlan’s picture

Status: Needs work » Postponed (maintainer needs more info)

So this is about the treatment of NULL?

Status: Postponed (maintainer needs more info) » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.