[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
Mon Oct 26 00:03:55 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 needs-testing
--------------------------+-------------------------------------------------

Comment(by azaozz):

 How about changing:
 {{{
 $temp_ID = -1 * time();
 }}}
 to
 {{{
 $temp_ID = time() . '00000000';
 }}}

 Don't think any site would ever have over a quintillion posts... Then the
 new attachments will be attached while saving the post. This would work
 for #10521 too.

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


More information about the wp-trac mailing list