Bug #1210

Posting draft to metaweblog api with blank creation date is saving article as published

Added by benjackson - 131 days ago. Updated 99 days ago.

Status :Closed Start :
Priority :Normal Due date :
Assigned to :scott - % Done :

0%

Category :backend
Target version :-
Resolution :

fixed


Description

When posting a draft without specifying dateCreated to a future date, typo is saving the article as published. This is because it sets published_at by default to Time.now, and the state hooks which check the time to determine published status see that the time is before Time.now (even though it's probably milliseconds after) and mark it as published. Changing the order of assignments in

MetaWeblogService#newPost
resolves the issue. Patch is attached.

P.S. It might be prudent to advise weblog client authors that to support drafts for older versions they should always send a dateCreated set to Time.now + 300 (now + 5 minutes).

draft_with_blank_creation_date.diff (2.2 KB) benjackson -, 02/25/2008 04:47 PM

History

03/28/2008 09:04 PM - neuro -

  • Status changed from New to Closed
  • Resolution set to fixed

Fix in changeset 1681.

Also available in: Atom PDF