Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently, if you select Date-descending sort in Forum settings, they actually sort by timestamp of most recent comment (or something like that). The result is that if you have a fair number of posts with no comments, the sort order appears to be random.
Actual date sort can be achieved by changing function _forum_get_topic_order() in forum.module.
Change l.last_comment_timestamp to n.created, so the final version looks like this:
case 1:
return array('field' => 'n.created', 'sort' => 'desc');
break;
case 2:
return array('field' => 'n.created', 'sort' => 'asc');
break;
Otherwise, an even better idea would be to created-date sort option to the other sort options.
Comment | File | Size | Author |
---|---|---|---|
#3 | forum-513816-3.patch | 4.64 KB | jyr |
Comments
Comment #1
swe3tdave CreditAttribution: swe3tdave commentedi have the same problem in 6.15, and i think we can consider this as a bug, when using date-descending, the script should use n.created to sort the topics that dont have comments, instead of just putting them first. i imported a few years of mailling list using mailhander and listhandler, and the problem i have is that i have a few page of topics with no reply before the other topics... this is not as is should be. Of course i can put n.created instead of l.last_comment_timestamp, but it doesn't help with recurring topics, like the topic for the linux meetup each month that should be on the first page, but instead gets forgotten with the topics that where created that month with a couple of years in between.
Comment #2
marcingy CreditAttribution: marcingy commentedThis is a feature request as the existing behaviour does in fact work.
Comment #3
jyr CreditAttribution: jyr commentedI create patch for order sort by date
Comment #4
alexweber CreditAttribution: alexweber commentedLets feed this to the testbot! :)
Comment #6
alexweber CreditAttribution: alexweber commented#3: forum-513816-3.patch queued for re-testing.
Comment #8
DevElCuy CreditAttribution: DevElCuy commentedAdding tag "dlatino" for reference of the Drupal Latino community.
Comment #21
quietone CreditAttribution: quietone at PreviousNext commentedForum is approved for removal. See #1898812: [policy] Deprecate forum module for removal in Drupal 11
This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
It will be moved to the contributed extension once the Drupal 11 branch is open.
Comment #23
quietone CreditAttribution: quietone at PreviousNext commented