[wp-trac] Re: [WordPress Trac] #9471: Attachments uploaded before
post is saved or autosaved get 0 (zero) for post_parent (instead of
temp_id value)
WordPress Trac
wp-trac at lists.automattic.com
Fri Jun 26 14:35:23 GMT 2009
#9471: Attachments uploaded before post is saved or autosaved get 0 (zero) for
post_parent (instead of temp_id value)
---------------------------------+------------------------------------------
Reporter: aesqe | Type: defect (bug)
Status: new | Priority: normal
Milestone: 2.8.1 | Component: Autosave
Version: 2.8 | Severity: major
Keywords: needs-patch blocker |
---------------------------------+------------------------------------------
Comment(by Denis-de-Bernardy):
@azaozz: we must be reading that ticket differently. UUID works fine and
is globally unique in time and space (in theory anyway). md5(uniqid())
would introduce collisions (in theory again) if used to do the same thing.
The part that didn't work until MySQL 5.1 is this: servers s1/s2, with
statements on s1 being replicated over on s2. the statement, insert into
table (guid) values(uuid()), would then make uuid() run on the two servers
independently, resulting a separate uuid being generated on each server.
the workaround is easy, too: store the results of select uuid() into
$uuid, and then, insert into table(guid) values($uuid).
In my non-WP apps, I'm constantly using UUIDs to deal with double clicks
on forms that have yet to be inserted data, e.g. when a user tries to
register and clicks the submit button twice, when a new page is created
and the save button gets clicked twice, etc. It's a lot more robust than
trying to disable submit buttons.
But we're getting off topic. :-)
--
Ticket URL: <http://core.trac.wordpress.org/ticket/9471#comment:23>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list