post_order_column
Submitted
Jason H
, May 12 2012 12:20 PM | Last updated May 12 2012 12:20 PM
I haven't NOTICED this being a problem, but, something is itching in my brain that it may wind up being one..
We have removed the post_order_column setting, apparently. Which.. Seems to me that might cause some problems with conversions, but.. The only one I ran into, they had a conversion done before, and when they upgraded to 3.3.2, because the setting was removed, it knocked their sort on converted topics off. Because, we had changed it to sort by post_date rather than pid to get them to sort right originally. Not an issue, changing it to descending solved it.. But, something tells me there might be a case where this is an issue..
BUT.. The main thing is this..
That's from rebuildTopic, but.. That code or similar is floating around elsewhere as well..
Since there is no longer a post_order_column setting, it's forcing it to PID
And.. This is a problem. I have one of those sites right now, where the PIDs are incorrect, and it has to be sorted by post_date.. Well, there is no more post_order_column, so, it's never going to be post_date, which means it's forced to PID.
So, when you resynch topics, it's always showing the FIRST topic as the 'last_post', so, if you have archiving enabled, since it keys on the last_post column, it's going to archive any topic that was STARTED before the time that it's set to archive based on when the last reply was.
Long story short.. You have archiving set to anything with no replies in over 1 year. This is a convert, so, PID 500 is 1/1/2005, PID 300 is the same topic, a reply dated today
When you resynch, it's going to set the topic table last_post of 1/1/2005.. That topic will be archived when it shouldn't be.
We have removed the post_order_column setting, apparently. Which.. Seems to me that might cause some problems with conversions, but.. The only one I ran into, they had a conversion done before, and when they upgraded to 3.3.2, because the setting was removed, it knocked their sort on converted topics off. Because, we had changed it to sort by post_date rather than pid to get them to sort right originally. Not an issue, changing it to descending solved it.. But, something tells me there might be a case where this is an issue..
BUT.. The main thing is this..
if ( $this->settings['post_order_column'] != 'post_date' )
{
$this->settings[ 'post_order_column'] = 'pid' ;
}
That's from rebuildTopic, but.. That code or similar is floating around elsewhere as well..
Since there is no longer a post_order_column setting, it's forcing it to PID
And.. This is a problem. I have one of those sites right now, where the PIDs are incorrect, and it has to be sorted by post_date.. Well, there is no more post_order_column, so, it's never going to be post_date, which means it's forced to PID.
So, when you resynch topics, it's always showing the FIRST topic as the 'last_post', so, if you have archiving enabled, since it keys on the last_post column, it's going to archive any topic that was STARTED before the time that it's set to archive based on when the last reply was.
Long story short.. You have archiving set to anything with no replies in over 1 year. This is a convert, so, PID 500 is 1/1/2005, PID 300 is the same topic, a reply dated today
When you resynch, it's going to set the topic table last_post of 1/1/2005.. That topic will be archived when it shouldn't be.
| Status: | Fixed |
| Version: | 3.3.2 |
| Fixed In: | 3.3.3 |











8 Comments
Adding this in conf_global.php can bring back the correct sorting:
problem is this in the rebuild.
$first_post = $this->DB->buildAndFetch( array( 'select' => 'p.post_date, p.author_id, p.author_name, p.pid', 'from' => array( 'posts' => 'p' ), 'where' => 'p.pid=' . intval( $minMax['min'] ), 'add_join' => array( array( 'select' => 'm.member_id, m.members_display_name', 'from' => array( 'members' => 'm' ), 'where' => "p.author_id=m.member_id", 'type' => 'left' ), array( 'select' => 'tp.pid as has_poll_id', 'from' => array( 'polls' => 'tp' ), 'where' => 'p.topic_id=tp.tid', 'type' => 'left' ) ) ) );Whether you're sorting by post_date or PID, it's using the max/min values.. Which.. If you're sorting by post date.. Ain't gonna fly.
the "Started by" section is the problem.. Seems to me there SHOULD be a problem in the 'last post' area as well.. And, I may just not see this on his site, because it may work out right, or someone might have posted to this topic after the conversion..
I have also noticed that it should actually use the option "onlyVisible" instead of "onlyViewable" or am I missing something? We still need to look into adding a warning in the upgrader as well.
Not sure how we can add a warning on the upgrader, though?