Make WordPress Core

Opened 19 years ago

Closed 19 years ago

Last modified 19 years ago

#2439 closed defect (bug) (fixed)

Can't Publish pages; get saved with future post_status

Reported by: michaelh's profile MichaelH Owned by:
Milestone: 2.1 Priority: normal
Severity: normal Version: 2.0.1
Component: Administration Keywords:
Focuses: Cc:

Description

Using 2.0.1-alpha1 (revision 3523) and any page I try to Publish gets marked with a post_status of 'future'.

I can save a page as either private or draft status and then change them to any post_status but 'publish'. I can change a 'future' post to any other status but publish.

Change History (3)

#1 @ryan
19 years ago

I think there's something up with mysql2date('U', ...).

This code:

echo "Post Date: " . $post->post_date . "<br />";
echo "Post Date GMT: " . $post->post_date_gmt . "<br />";
echo "Post Date Timestamp: " . mysql2date('U', $post->post_date) . "<br />";
echo "Post Date GMT Timestamp: " . mysql2date('U', $post->post_date_gmt) . "<br />";
echo "Current Time: " . current_time('mysql') . "<br />";
echo "Current Time GMT: " . current_time('mysql', 1) . "<br />";
echo "Current Timestamp: " . current_time('timestamp') . "<br />";
echo "Current Timestamp GMT: " . current_time('timestamp', 1) . "<br />";

Produces this output:

Post Date: 2006-02-13 12:12:36
Post Date GMT: 2006-02-13 20:12:36
Post Date Timestamp: 1139861556
Post Date GMT Timestamp: 1139890356
Current Time: 2006-02-13 12:12:52
Current Time GMT: 2006-02-13 20:12:52
Current Timestamp: 1139832772
Current Timestamp GMT: 1139861572

Notice that "Current Timestamp GMT" is less than "Post Date GMT Timestamp". That's the problem.

#2 @ryan
19 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3525]) Fix timestamps for future posts. fixes #2439

#3 @ryan
19 years ago

  • Milestone set to 2.1
Note: See TracTickets for help on using tickets.