[wp-trac] [WordPress Trac] #10244: metaWeblog.getPost XML-RPC method should return the correct date/time for the date_created_gmt field for draft posts

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 23 15:50:46 GMT 2009


#10244: metaWeblog.getPost XML-RPC method should return the correct date/time for
the date_created_gmt field for draft posts
--------------------------+-------------------------------------------------
 Reporter:  josephscott   |       Owner:  josephscott
     Type:  defect (bug)  |      Status:  new        
 Priority:  normal        |   Milestone:  2.8.1      
Component:  XML-RPC       |     Version:  2.8        
 Severity:  normal        |    Keywords:  has-patch  
--------------------------+-------------------------------------------------
 Because WP uses post_date_gmt database field internally to trigger certain
 events draft posts don't get a valid date/time (it uses 0000-00-00
 00:00:00), but they do get a valid post_date entry in the DB.

 XML-RPC clients run into problems when calling metaWeblog.getPost on
 drafts because of this.  The dateCreated field uses the DB post_date field
 for the draft and the date_created_gmt uses the post_date_gmt DB field.
 So the response has dateCreated with a valid date and date_created_gmt
 with some screwy date (usually 1969 or 1999).

 Seems the more correct thing to do would be to provide the right GMT
 date/time in the date_created_gmt field for drafts.  I'm including a patch
 that will populate the date_created_gmt field when metaWeblog.getPost is
 called on a draft by calling get_gmt_from_date() and then tweaking the
 result to be correctly formatted for the XML-RPC response.

 I consider this a bug and would like to see it get into the 2.8.1 release.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10244>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list