Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#5456 closed defect (bug) (fixed)

wxr import: post_parent is handled incorrectly in some circumstances

Reported by: tellyworth Owned by:
Milestone: 2.5 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:


The patch in #5357 handles parent/child pages incorrectly in some cases, when there are multiple levels of nesting and the posts are included in the least optimal order in the import file. The Level 1 / Level 2 / Level 3 pages in this export file reproduce the problem:


The enclosed patch replaces the two pass processing from #5357 with a simpler method. Posts are imported in a single pass, then the post_parent of child pages are updated in backfill_parents() later, once the local post ID's of all parents are known. I also removed a little cruft and split the import() function in two for easier testing.

This passes the updated unit tests here:


Attachments (2)

import_backfill_parents-r6367.patch (4.5 KB) - added by tellyworth 8 years ago.
import_backfill_parents-r6367-a.patch (4.5 KB) - added by tellyworth 8 years ago.
Revised patch fixes a problem with categories

Download all attachments as: .zip

Change History (4)

8 years ago

Revised patch fixes a problem with categories

#1 @ryan
8 years ago

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

(In [6374]) Correctly handle post_parent during import. Props tellyworth. fixes #5456

#2 @santosj
8 years ago

  • Milestone changed from 2.5 to 2.4

Fixed on trunk.

Note: See TracTickets for help on using tickets.