Opened 16 years ago
Closed 14 years ago
#6265 closed defect (bug) (duplicate)
Wordpress importer skips posts having the same title during import process
Reported by: | jayminkapish | Owned by: | tellyworth |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.5 |
Component: | Import | Keywords: | needs-patch import |
Focuses: | Cc: |
Description
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.
- 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)) {
- 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.
Attachments (5)
Change History (16)
#2
@
16 years ago
jayminkapish, please don't attach modified files, instead attach a patch. Also, it looks liek you are using an older version of WordPress. Please provide your modification verses the current trunk. Thanks for participating in WordPress!
#3
@
16 years ago
Hi Lloyd,
Files I attached were of Wordpress MU. I am sorry I did not mention that.
I have attached two patches now. One of them is for Wordpress MU (wpmu-importer.patch) and other one is for Wordpress (wp-importer.patch).
Thanks, Jaymin
#4
follow-up:
↓ 6
@
16 years ago
Also, post_exists() function is used by all other files under wp-admin/import/ folder. You may want to change something there. Thanks, Jaymin
#5
@
16 years ago
- Keywords has-patch import added
- Milestone changed from 2.7 to 2.6
- Version set to 2.5
#6
in reply to:
↑ 4
@
16 years ago
Replying to jayminkapish:
Also, post_exists() function is used by all other files under wp-admin/import/ folder. You may want to change something there. Thanks, Jaymin
I found a fix to this issue. Rather than dealing with all files under wp-admin/import/, we can add one more optional parameter to post_exists function, post_name.
Patch attached: wordpress-importer-new.patch
Wordpress Importer File