Ticket #3840 (closed defect: duplicate)

Opened 2 years ago

Last modified 2 years ago

WXR imported pages dissapear

Reported by: sunburntkamel Assigned to: technosailor
Priority: low Milestone:
Component: General Version: 2.1
Severity: normal Keywords: WXR import export pages CMS
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

import.php.diff (1.8 kB) - added by technosailor on 03/28/07 22:06:51.
Reupped. Diff on wrong file

Change History

02/22/07 13:01:13 changed by sunburntkamel

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

02/24/07 03:12:30 changed by jschwanz

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

03/28/07 02:25:50 changed by foolswisdom

  • milestone changed from 2.1.3 to 2.2.

03/28/07 21:08:37 changed by technosailor

  • owner changed from anonymous to technosailor.

03/28/07 22:05:29 changed by technosailor

Diff screwed. New one coming with explanation.

03/28/07 22:06:51 changed by technosailor

  • attachment import.php.diff added.

Reupped. Diff on wrong file

03/28/07 22:08:03 changed by technosailor

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.

04/01/07 04:33:40 changed by takayukister

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?)

04/01/07 17:32:44 changed by technosailor

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.

04/12/07 01:33:10 changed by ryan

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

Duping against 4025.

04/19/07 21:07:13 changed by Nazgul

  • milestone deleted.