[wp-trac] [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 Nov 20 13:07:37 UTC 2009


#9471: Attachments uploaded before post is saved or autosaved get 0 (zero) for
post_parent (instead of temp_id value)
--------------------------+-------------------------------------------------
 Reporter:  aesqe         |       Owner:  scribu                 
     Type:  defect (bug)  |      Status:  accepted               
 Priority:  normal        |   Milestone:  2.9                    
Component:  Media         |     Version:  2.8                    
 Severity:  blocker       |    Keywords:  has-patch tested commit
--------------------------+-------------------------------------------------
Changes (by scribu):

  * keywords:  has-patch tested => has-patch tested commit


Comment:

 Let's review:

 [http://core.trac.wordpress.org/attachment/ticket/9471/_relocate_children.diff
 _relocate_children.diff] simply saves the temp_ID in postmeta, instead of
 wp_posts.post_parent.

 This fixes the current problem with attachments getting 0 as post_parent.

 At the same time, it doesn't introduce any regressions, as the race
 condition mentioned by Denis-de-Bernardy would have occured before the
 schema was modified.

 Furthermore, changing the way $temp_ID is generated would cause problems
 with autosave collisions etc.

 I say we go with _relocate_children.diff until a more robust ideea
 emerges.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9471#comment:52>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list