[wp-trac] Re: [WordPress Trac] #6527: Publishing directly sets wrong date on 'post_date_gmt'

WordPress Trac wp-trac at lists.automattic.com
Fri Apr 11 08:25:34 GMT 2008


#6527: Publishing directly sets wrong date on 'post_date_gmt'
-----------------------------+----------------------------------------------
 Reporter:  arabek           |        Owner:  anonymous
     Type:  defect           |       Status:  new      
 Priority:  highest omg bbq  |    Milestone:  2.5.1    
Component:  General          |      Version:  2.5      
 Severity:  critical         |   Resolution:           
 Keywords:                   |  
-----------------------------+----------------------------------------------
Comment (by arabek):

 Replying to [comment:2 techcookies]:
 > actually, when publishing directly it sets the post_date_gmt right, but
 if the post has been saved (as draft) in the mean time, post_date_gmt is
 left at '0000-00-00 00:00:00'. I think the bug is in wp-includes/post.php
 at line 1234, where it checks for empty(post_date_gmt). When post has been
 saved for the first time (i.e. as draft), post_date_gmt won't be empty,
 but will contain '0000-00-00 00:00:00'.
 >
 > So the line should read
 >
 > if (empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt) {
 >
 > I will post a patch for review.

 After posting a few times, the problem occured again. Still no clue, what
 is wrong, but after applying your patch to the "post.php" and editing an
 already published post with a wrong "post_date_gmt", the post has been
 updated to a correct date:

 {{{
 mysql> select ID, post_date, post_date_gmt from wp_posts where
 post_title='Pierwsze spojrzenie na nowe PS Store';
 +------+---------------------+---------------------+
 | ID   | post_date           | post_date_gmt       |
 +------+---------------------+---------------------+
 | 7407 | 2008-04-10 23:15:09 | 2008-04-10 21:15:09 |
 +------+---------------------+---------------------+
 1 row in set (0.01 sec)
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6527#comment:6>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list