[wp-trac] [WordPress Trac] #7707: WXR Import can generate orphan postmeta entries

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 8 03:49:19 GMT 2008


#7707: WXR Import can generate orphan postmeta entries
----------------------------+-----------------------------------------------
 Reporter:  dougal          |       Owner:  anonymous                                       
     Type:  defect          |      Status:  new                                             
 Priority:  normal          |   Milestone:  2.7                                             
Component:  Administration  |     Version:                                                  
 Severity:  normal          |    Keywords:  importer, wxr, wordpress, import, postmeta, meta
----------------------------+-----------------------------------------------
 There is a bug in the duplicate post detection of the WordPress WXR
 importer. The creation of postmeta occurs outside of the if branch which
 detects whether a post is a duplicate. I assume that this is in order to
 attach additional metadata to the copy of the post already in the database
 (which could be due to re-starting a previously interrupted import).
 However, due to the way the code is structured, the $post_id variable is
 not set in this case, and so the postmeta entries are assigned to
 post_id=0 (zero).

 The solution is to capture the post_id returned from the post_exists()
 function, and set the $post_id variable in the other branch of the
 duplicate post test.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7707>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list