[12987] creates a post with post_status of “auto-draft” when you create a new post item. The first save (auto- or otherwise) will change this to a draft. This means that there are no more negative post IDs. You always have a legit post ID from the very beginning.
Shane 3:57 am on February 8, 2010 Permalink
This should fix any issues with uploading images before you also save a post title. I havn’t tested it yet, but it should be the fix for it.
Brian Layman 5:00 pm on February 8, 2010 Permalink
And there was Much rejoicing!
Lee Newton 5:01 pm on February 8, 2010 Permalink
w00t!
Brian Layman 8:04 pm on February 8, 2010 Permalink
I’m curious. What was your methodology for working with the autosave.js in there? Do you have an expanded version that you recompress? Do you work with it in that big blob? Or maybe do you use a tool to expand the js to multiple lines?
Mark Jaquith 8:36 pm on February 8, 2010 Permalink
We have dev versions, in the repo. autosave.dev.js I turn on SCRIPT_DEBUG in wp-config.php so that my test install uses the .dev.js version (there is a similar one for CSS). When I’m happy with it, I use YUI to minify it and save the output as autosave.js
Brian Layman 8:50 pm on February 8, 2010 Permalink
Ah-haThanks!
I’d known about SCRIPT-DEBUG but had skimmed right past autosave.dev.js and was confused having only see the shortened version in the patch. I should have scrolled back up, not further down to find it.
Conversely, I’d not thought of using YUI for shortening. I’d always used a bookmarked site I’d found long ago. Thanks for the tip!
paul 5:26 am on July 13, 2011 Permalink
Not sure if this is a bug or a feature. I find my database has loads of “Auto Draft” entries and I get negative post IDs. That I can handle but messages of “You attempted to edit an item that doesn’t exist. Perhaps it was deleted?” are something I could do without. Any idea what that’s about?