Ticket #5456 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

wxr import: post_parent is handled incorrectly in some circumstances

Reported by: tellyworth Assigned to: anonymous
Priority: normal Milestone: 2.5
Component: General Version:
Severity: normal Keywords: has-patch
Cc:

Description

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:

http://svn.automattic.com/wordpress-tests/wp-testdata/export/asdftestblog1.2007-12-11.xml

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:

http://svn.automattic.com/wordpress-tests/wp-testcase/test_import_wp.php

Attachments

import_backfill_parents-r6367.patch (4.5 kB) - added by tellyworth on 12/11/07 10:29:04.
import_backfill_parents-r6367-a.patch (4.5 kB) - added by tellyworth on 12/11/07 11:32:42.
Revised patch fixes a problem with categories

Change History

12/11/07 10:29:04 changed by tellyworth

  • attachment import_backfill_parents-r6367.patch added.

12/11/07 11:32:42 changed by tellyworth

  • attachment import_backfill_parents-r6367-a.patch added.

Revised patch fixes a problem with categories

12/12/07 05:08:49 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

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

12/13/07 21:15:51 changed by santosj

  • milestone changed from 2.5 to 2.4.

Fixed on trunk.