Bug #442

Wrong dateline of split thread

Added by bosit man over 2 years ago. Updated almost 2 years ago.

Status:Closed Start date:08/30/2009
Priority:Normal Due date:
Assignee:Ryan Gordon % Done:

100%

Category:Moderation
Target version:1.4.10
Reproducibility:Always Database Type:MySQLi
Reported In MyBB Version:1.4.8 Database Version:5.0.67
PHP Version:5.2.6 SQA assignments:
Browser:Firefox 3.5.2

Description

MyBB 1.4.8

How to reproduce:

1)Create a new thread, post a reply in it some time after creation
2)Split the reply you made on the thread to a new one
3)New split thread has the issue: While the post dateline is correct (the time the post was posted in the original thread), the new split thread's dateline is the same of the original thread (meaning of the first post of the thread we replied to) instead of being either 1) the same as the post dateline or 2) (probably more correct) the date/time you made the split.

An example with real numbers might serve better:
Created new thread at 30/8/2009 1:34 (unix dateline 1251628463) and a reply to the thread at 30/8/2009 1:47 (unix dateline 1251629225)
I split the reply to a new thread. The new thread has 1) Dateline for the post 30/8/2009 1:47 (1251629225) which is correct, dateline for the thread 30/8/2009 1:34 (1251628463) which is wrong, should be either the date/time the split was made or at least the date/time the post was made (i.e. same as 1) above )

Associated revisions

Revision 4543
Added by Ryan Gordon over 2 years ago

Fixes Wrong dateline of split thread (fixes:442)

Revision 4556
Added by Ryan Gordon over 2 years ago

Fixes Wrong dateline of split thread (fixes:442)

History

#1 Updated by Ryan Gordon over 2 years ago

  • Category set to Moderation
  • Status changed from New to Assigned
  • Assignee set to Ryan Gordon
  • Target version set to 1.4.10

#2 Updated by Ryan Gordon over 2 years ago

We just need to update the lastpost information on the thread and forum tables as well

#3 Updated by Ryan Gordon over 2 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

Applied in changeset r4543.

#4 Updated by Michael Schlechtinger over 2 years ago

  • Status changed from Resolved to Feedback

This fix does not update the dateline column in the threads table. A possible fix is adding dateline to the update array in the update_thread_data() function.

Open inc/functions.php and find:

$update_array = array(
    'username' => $firstpost['username'],
    'uid' => intval($firstpost['uid']),
    'lastpost' => intval($lastpost['dateline']),
    'lastposter' => $lastpost['username'],
    'lastposteruid' => intval($lastpost['uid']),
);

Replace with:
$update_array = array(
    'username' => $firstpost['username'],
    'uid' => intval($firstpost['uid']),
    'dateline' => intval($firstpost['dateline']),
    'lastpost' => intval($lastpost['dateline']),
    'lastposter' => $lastpost['username'],
    'lastposteruid' => intval($lastpost['uid']),
);

#5 Updated by Ryan Gordon over 2 years ago

  • Status changed from Feedback to Resolved

Applied in changeset r4556.

#6 Updated by Michael Schlechtinger over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF