[wp-trac] [WordPress Trac] #6265: Wordpress importer skips posts having the same title during import process

WordPress Trac wp-trac at lists.automattic.com
Mon Mar 17 22:44:37 GMT 2008


#6265: Wordpress importer skips posts having the same title during import process
--------------------------+-------------------------------------------------
 Reporter:  jayminkapish  |       Owner:  anonymous
     Type:  enhancement   |      Status:  new      
 Priority:  normal        |   Milestone:  2.7      
Component:  General       |     Version:           
 Severity:  normal        |    Keywords:           
--------------------------+-------------------------------------------------
 I was importing couple of blogs to MU and I notice it was not importing
 everything. It skips posts with the same titles.

 Well, I can not say it is a bug. I may be the only one who has posts with
 same titles. But I would like it to be accurate.

 1. wp-admin/import/wordpress.php - line number 320.
 if ($post_id = post_exists($post_title, '', $post_date)) {
 post_exists function should pass $post_name to check whether post is
 exists or not! post_name is always unique in the database.
 it should be
 if ($post_id = post_exists($post_name, '', $post_date)) {

 2. wp-admin/includes/post.php - line number 172, 178 & 179
 172 should be
 function post_exists($post_name, $content = '', $post_date = '') {
 178 should be
 if (!empty ($post_name))
 179 should be
 return $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name =
 '$post_name' $post_date");

 If this change occurs, then it should be changed in all the files under
 wp-admin/import/ folder.

 I will attach the files I have changed.

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


More information about the wp-trac mailing list