Make WordPress Core

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#22350 closed defect (bug) (duplicate)

Restored Drafts Shouldn't Have a Publication Date

Reported by: miqrogroove's profile miqrogroove Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4.2
Component: Posts, Post Types Keywords: editorial-flow
Focuses: Cc:

Description

After creating a draft, trashing it, and then restoring it, the post editor shows a "Publish on" date as though it were a scheduled post, and the Date value in the list of all posts will be wrong after further editing (e.g. "3 hours ago, Last Modified").

Change History (9)

#2 @miqrogroove
12 years ago

Nacin and I noticed the related date issues while fixing #21858. There seems to be a lot of confusion about which value is supposed to go into each of the date fields.

#3 @navjotjsingh
12 years ago

  • Cc navjotjsingh@… added

#4 @SergeyBiryukov
12 years ago

  • Keywords editorial-flow added

#5 @danielbachhuber
12 years ago

The timestamp is set because of this block:

	if ( empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt ) {
		if ( !in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) )
			$post_date_gmt = get_gmt_from_date($post_date);
		else
			$post_date_gmt = '0000-00-00 00:00:00';
	}

Similarly, if you trash a 'draft' and haven't yet set a slug / post_name, the slug / post_name will be set when you restore it from trash.

Related #18362

#6 @nacin
11 years ago

  • Component changed from Trash to Posts, Post Types

#8 @Denis-de-Bernardy
11 years ago

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

Dup of #19907 (it has a patch that fixes this.)

Last edited 11 years ago by Denis-de-Bernardy (previous) (diff)

#9 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.