WordPress.org

Ready to get started?Download WordPress

Forums

post_date_gmt fix (6 posts)

  1. skippy
    Member
    Posted 10 years ago #

    Upgrading from 1.02 to 1.2 introduces a post_date_gmt row for the wp_posts table. The upgrade script creates this row as needed, and it's supposed to add GMT dates for all existing posts. Except that it doesn't.
    The fix is easy: remove the exclamation point on line 747.
    Line 747 of wp-admin/upgrade-functions.php:
    if (!$got_gmt_fields) {
    Change it to:
    if ($got_gmt_fields) {

  2. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    Wouldn't this cause the times to be adjusted every time upgrade.php is run?

  3. skippy
    Member
    Posted 10 years ago #

    Yes, as a matter of fact it would. But since most folks will only be upgrading once (from their current install to 1.2 stable), you should have time to develop a better solution for 1.3! =)

  4. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    That's not acceptable. We need to find out why it thinks the dates have been updated already.

  5. ottofilm
    Member
    Posted 10 years ago #

    I have that line on line 762 (5/5 nightly). I'm not 100% on this as it's late and this isn't my code, but it appears to me that $got_gmt_fields is set to zero on line 762, and then line 762 is checking to see if the variable is null or not set. Correct me if I'm wrong, but I think the zero in there sets the variable.
    I checked on this because all my GMT times in my imported entries are all set to default 0000's and I'd like to get them set properly, but I don't think this is the issue.

  6. skippy
    Member
    Posted 10 years ago #

    michel_v's fix in the 1.2 delta which checks the MAX value of post_date_gmt appears to work properly. Upgrading from 1.02 to 1.2 delta correctly creates GMT times for upgraded posts.
    Keep up the great work!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.