WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#4025 closed defect (bug) (fixed)

WXR importing does not treat change of post_parent

Reported by: takayukister Owned by:
Milestone: 2.2 Priority: high
Severity: normal Version: 2.2
Component: Administration Keywords: import has-patch WXR
Focuses: Cc:

Description

Importing of WordPress eXtended RSS (WXR) newly assigns ID to each posts, instead it takes over old ID from exporting. Because the post_parent column of post is not correctly changed to the new ID, this causes break of parent-child relationship between posts. All pages which has parent page and all attachments can be orphaned.

Attachments (1)

import-wordpress.diff (3.3 KB) - added by takayukister 8 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 @takayukister8 years ago

I wrote a patch for this. Which does two things,

1) If importing post has post_parent and the parent post is not processed yet, process the parent first.
2) Remember old and new ID of post, and rewrite each post_parent old to new.

comment:2 @foolswisdom8 years ago

  • Milestone changed from 2.3 to 2.2

comment:3 @JeremyVisser8 years ago

+1.

Coincidentally, I just encountered this while migrating my WordPress blog to a WordPress MU blog, and realising the page tree hadn't been saved.

comment:4 @technosailor8 years ago

I created another fix, not knowing this one was here, that has less code changes. It may or may not be as effective. [3840]

comment:6 @ryan8 years ago

  • Priority changed from low to high

comment:7 @foolswisdom8 years ago

  • Keywords WXR added

comment:8 @ryan8 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [5245]) Preserve page hierarchy. Props takayukister. fixes #4025

Note: See TracTickets for help on using tickets.