XF 1.5 Still having server time sync problems--

leslie dow

Active member
I am still seeing the problem where the post appears to be posted in the future and thus any posts made as child posts throw the following error:

I and my hosting service has confirmed the server time is set correctly. They have asked for a test case within Xenforo that shows how Xenforo pulls the server time off the server or from within Xenforo.

Can you help with this?

Thanks

Error Info XenForo_Exception: Cannot insert a message in the middle of a discussion. - library/XenForo/DataWriter/DiscussionMessage.php:449
Generated By: Tracy Koppel, Today at 3:34 PM
Stack Trace #0 /home/savvyauthors/public_html/Community/library/XenForo/DataWriter/DiscussionMessage.php(354): XenForo_DataWriter_DiscussionMessage->_setPosition()
#1 /home/savvyauthors/public_html/Community/internal_data/proxy_classes/XenForo_DataWriter__1523438778.php(1460): XenForo_DataWriter_DiscussionMessage->_preSave()
#2 /home/savvyauthors/public_html/Community/library/CMF/Core/DataWriter/Abstract.php(124): XFProxy_XenForo_DataWriter->preSave()
#3 /home/savvyauthors/public_html/Community/library/XenForo/ControllerPublic/Thread.php(571): CMF_Core_DataWriter_Abstract->preSave()
#4 /home/savvyauthors/public_html/Community/library/CMF/Thread/ControllerPublic/Extend/Thread.php(89): XenForo_ControllerPublic_Thread->actionAddReply()
#5 /home/savvyauthors/public_html/Community/library/XenForo/FrontController.php(369): CMF_Thread_ControllerPublic_Extend_Thread->actionAddReply()
#6 /home/savvyauthors/public_html/Community/library/XenForo/FrontController.php(152): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#7 /home/savvyauthors/public_html/Community/index.php(13): XenForo_FrontController->run()
#8 {main}
Request State array(3) {
["url"] => string(101) "https://savvyauthors.com/Community/...ly-challenge-2nd-weeks-thread.33832/add-reply"
["_GET"] => array(1) {
["threads/daily-challenge-2nd-weeks-thread_33832/add-reply"] => string(0) ""
}
["_POST"] => array(10) {
["message_html"] => string(86) "<p>Awesome!</p>
<p>&nbsp;</p>
<p>(Great day to have missed the Daily Challenge!)</p>"
["_xfRelativeResolver"] => string(92) "https://savvyauthors.com/Community/index.php?threads/daily-challenge-2nd-weeks-thread.33832/"
["post_id"] => string(5) "96501"
["parent_id"] => string(5) "96501"
["_xfToken"] => string(8) "********"
["last_date"] => string(10) "1523484512"
["page"] => string(1) "1"
["_xfRequestUri"] => string(68) "/Community/index.php?threads/daily-challenge-2nd-weeks-thread.33832/"
["_xfNoRedirect"] => string(1) "1"
["_xfResponseType"] => string(4) "json"
}
}
 
First thing to try is disabling whatever add-on the CMF thing is.

XenForo itself uses the 'UTC' time zone for all of it's time recording and calculations, and I'd bet that add-on is changing the time for posts to a time zone west of GMT which would place the time in the past. But I could be wrong about the add-on changing it. The only way to tell is to disable it and see if the problem goes away, or inspect the code for the add-on.

XenForo time...
Code:
date_default_timezone_set('UTC');

self::$time = time();
 
Last edited:
I did disable that yesterday when testing and it still happened. And by "it" I mean a post was logged with a date in the future. My hosting service is asking the following:

"Are you aware if the site code utilizes queries to the database that may be pulling time stamp information from the database and not from the server itself?"

Thanks

First thing to try is disabling whatever add-on the CMF thing is.

XenForo itself uses the 'UTC' time zone for all of it's time recording and calculations, and I'd bet that add-on is changing the time for posts to a time zone west of GMT which would place the time in the past. But I could be wrong about the add-on changing it. The only way to tell is to disable it and see if the problem goes away, or inspect the code for the add-on.

XenForo time...
Code:
date_default_timezone_set('UTC');

self::$time = time();
 
"Are you aware if the site code utilizes queries to the database that may be pulling time stamp information from the database and not from the server itself?"
It does not do this for setting the current timestamp. The code I gave in my post is how xenForo itself gets the time. And is what is used for posts, etc.

The only thing I can think of is if the original post (or the reply) is made from an add-on and the add-on is using some other timestamp as the post date.

Wish I could help more, but that's all I've got.
 
Top Bottom