XF 1.5 Wrong Server Time Messed Up Forum

Recep Baltaş

Well-known member
Hi,

my stupid hosting provider ****ed up again as always and the server time went 1 day ahead. Told them, fixed the problem but this is now casuing some issues on the forum like:

Code:
Hata Bilgisi
XenForo_Exception: Cannot insert a message in the middle of a discussion. - library/XenForo/DataWriter/DiscussionMessage.php:449
Oluşturan: furkannaci34, 14 dakika önce
Yığın Takibi
#0 /home/technopa/public_html/sosyal/library/XenForo/DataWriter/DiscussionMessage.php(354): XenForo_DataWriter_DiscussionMessage->_setPosition()
#1 /home/technopa/public_html/sosyal/library/XenForo/DataWriter.php(1446): XenForo_DataWriter_DiscussionMessage->_preSave()
#2 /home/technopa/public_html/sosyal/library/XenForo/ControllerPublic/Thread.php(550): XenForo_DataWriter->preSave()
#3 /home/technopa/public_html/sosyal/library/WMTech/DoublePost/ControllerPublic/Thread.php(48): XenForo_ControllerPublic_Thread->actionAddReply()
#4 /home/technopa/public_html/sosyal/library/XenForo/FrontController.php(347): WMTech_DoublePost_ControllerPublic_Thread->actionAddReply()
#5 /home/technopa/public_html/sosyal/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#6 /home/technopa/public_html/sosyal/index.php(13): XenForo_FrontController->run()
#7 {main}
Talep Yeri
array(3) {
  ["url"] => string(79) "https://www.technopat.net/sosyal/konu/1500-tl-sistem-tavsiyesi.247313/add-reply"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(9) {
    ["message_html"] => string(295) "<p>Bilgisayarı aldıktan sonra 1 tane daha fazladan ram takmayacaksan Ram olarak 2x4 alırsan daha iyi performans alırsın.&nbsp;Tek modülde sıkıntı yaşamazsın ama daha sonradan bir tane daha takarım dersen yine aynı model (CL, MHz, GB değerleri aynı) olan bellekten alabilirsin.</p>"
    ["_xfRelativeResolver"] => string(76) "https://www.technopat.net/sosyal/konu/1500-tl-sistem-tavsiyesi.247313/page-3"
    ["attachment_hash"] => string(32) "a0bdbff0917389c01210599f3292829b"
    ["last_date"] => string(10) "1442792326"
    ["last_known_date"] => string(10) "1442792326"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(51) "/sosyal/konu/1500-tl-sistem-tavsiyesi.247313/page-3"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}

Any help ? Which counter should I refresh ?
 
Last edited:
There possibly is, but it's possibly a bit dodgy.

Code:
UPDATE xf_post SET post_date = (post_date - 86400) WHERE post_date > UNIX_TIMESTAMP()
Code:
UPDATE xf_thread SET post_date = (post_date - 86400) WHERE post_date > UNIX_TIMESTAMP()

If there are any threads or posts that were created after the current time stamp, it will set them to be 24 hours earlier.

There's some issues with this. It only deals with threads and posts - it doesn't deal with conversations. It also doesn't deal with things like the last_post_date caches and that kind of thing, so at the very least you'll need to do a full rebuild of posts and discussion counters.

Aside from that, I'm not 100% sure that running it won't cause any adverse effects.

At the very least you should run some detailed tests, first, before running the queries and ensure you have done a full back up and be prepared to roll back to that back up if anything goes wrong or anything else unexpected happens.
 
Just move your server time ahead 1 day again and slowly go back to normal over the next several days.

I would do 30 minutes each 2nd hour or 15 minutes each hoer. You will run into problems again with some threads, but those problem will be solved max 30 or 15 minutes later.
 
Top Bottom