I have a custom content type ('article') that is forum enabled. We use Scheduler to queue these up to go live. But at the moment, when they go live they don't seem to sort by the "Created" column.
We have Forum settings set to sort by "Date" newest first, but they don't seem to really sort that way.... I don't know if it's doing it by NID or what.

Tried editing these posts to change the updated date... in case maybe it was sorting by those. No change.

So here are my questions...
1) What do these really sort by (very specifically... can you tell me what field in what table in the db?)
2) If they don't sort by the displayedCreated date by default, how might hack things to make that happen?

Comments

aharown07’s picture

I'm using Advanced Forum, by the way, but this doesn't seem to have anything to do w/that.
In any case, there's a column header to sort by Created date... the link for the header is http://sharperiron.org/sharperiron-forums/front-page-article-forum?sort=...

So is there some way...thematically maybe, I can make all links to all forums take that form and sort by Created?

aharown07’s picture

Michelle tells me it has to do w/function _forum_get_topic_order... I'm not sure what to do w/that info though.
It's here in forum.module...

<?php
function _forum_get_topic_order($sortby) {
  switch ($sortby) {
    case 1:
      return array('field' => 'l.last_comment_timestamp', 'sort' => 'desc');
      break;
    case 2:
      return array('field' => 'l.last_comment_timestamp', 'sort' => 'asc');
      break;
    case 3:
      return array('field' => 'l.comment_count', 'sort' => 'desc');
      break;
    case 4:
      return array('field' => 'l.comment_count', 'sort' => 'asc');
      break;
  }
}
?>

What I don't get is where in here is the case that makes it sort by "date"?

aharown07’s picture

Fix here http://drupal.org/node/374913#comment-1789536
It's a core hack though. :(