WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#3840 closed defect (bug) (duplicate)

WXR imported pages dissapear

Reported by: sunburntkamel Owned by: technosailor
Milestone: Priority: low
Severity: normal Version: 2.1
Component: General Keywords: WXR import export pages CMS
Focuses: Cc:

Description

when importing via a wordpress-generated export file (XML file), any pages that have a value for post_parent dissapear from the dashboard ( Manage > Pages ), and must be editted in PHPMyAdmin or similar to assign them a new post_parent value that reflects the new page ID's.

Attachments (1)

import.php.diff (1.8 KB) - added by technosailor 7 years ago.
Reupped. Diff on wrong file

Download all attachments as: .zip

Change History (11)

comment:1 sunburntkamel7 years ago

export environment: IIS, with MySQL 4.1.21-community-nt
PHP Version 4.3.1 CGI/FastCGI

import environment (XAMPP): Apache/2.2.2 (Win32), MySQL - 5.0.21-community-nt, PHP/5.1.4

comment:2 jschwanz7 years ago

I've experienced the same issue. Both environments are LAMP.

comment:3 foolswisdom7 years ago

  • Milestone changed from 2.1.3 to 2.2

comment:4 technosailor7 years ago

  • Owner changed from anonymous to technosailor

comment:5 technosailor7 years ago

Diff screwed. New one coming with explanation.

technosailor7 years ago

Reupped. Diff on wrong file

comment:6 technosailor7 years ago

This patch simply takes source blog ID numbers and places them in a lookup array with new post IDs. This way, we can refer to the the lookup array for proper post_parent associations.

Up for suggestions on a more elegant solution that doesn't query mysql.

comment:7 takayukister7 years ago

Hi technosailor,

I checked this patch and found a defect. In case pretty permalink is used, it can generate incorrect guid. For example, when a page "Child" has a parent page "Parent", the child's guid should be:

http://example.com/parent/child

But applied this patch, it'll be:

http://example.com//child

This is because the original importing code uses wp_insert_post() to generate new posts, it needs the post name of the parent page to generate child's guid. So I think it would be safe to process parent first. (I created another patch. http://trac.wordpress.org/ticket/4025 If two places are reporting the same issue, should we merge?)

comment:8 technosailor7 years ago

takayukister,

I'm happy if your patch is used. I think the key thing is that _a_ patch gets applied relatively soon. In addition, there are quite a few WXR bugs in trac. Maybe you want to expand your patch to address those issues as well and we can get one of the guys to commit and kill multiple birds with one stone.

Thanks for the feedback.

comment:9 ryan7 years ago

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

Duping against 4025.

comment:10 Nazgul7 years ago

  • Milestone 2.2 deleted
Note: See TracTickets for help on using tickets.