From 8d3218c90ab1a32f76251bbc5b3370c8a2faf3e4 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 17 Sep 2008 21:47:27 +0000 Subject: [PATCH] Update post_date for old drafts during upgrade. see #5698 git-svn-id: https://develop.svn.wordpress.org/trunk@8921 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/upgrade.php | 10 +++++++++- wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index ec7cd4b7a1..148b8543da 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -210,7 +210,7 @@ function upgrade_all() { if ( $wp_current_db_version < 8201 ) upgrade_260(); - if ( $wp_current_db_version < 8539 ) + if ( $wp_current_db_version < 8921 ) upgrade_270(); maybe_disable_automattic_widgets(); @@ -752,6 +752,8 @@ function upgrade_252() { } function upgrade_260() { + global $wp_current_db_version; + if ( $wp_current_db_version < 8000 ) populate_roles_260(); @@ -762,8 +764,14 @@ function upgrade_260() { } function upgrade_270() { + global $wpdb, $wp_current_db_version; + if ( $wp_current_db_version < 8530 ) populate_roles_270(); + + // Update post_date for unpublished posts with empty timestamp + if ( $wp_current_db_version < 8921 ) + $wpdb->query( "UPDATE $wpdb->posts SET post_date = post_modified WHERE post_date = '0000-00-00 00:00:00'" ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index e692536db5..c7eb8b7537 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -15,6 +15,6 @@ $wp_version = '2.7-hemorrhage'; * * @global int $wp_db_version */ -$wp_db_version = 8890; +$wp_db_version = 8921; ?>