Make WordPress Core

Opened 15 years ago

Closed 14 years ago

#13364 closed defect (bug) (fixed)

Bug with tags and categories when importing from WP 2.9.2-exporting XML files

Reported by: gaobo's profile gaobo Owned by:
Milestone: WordPress.org Priority: normal
Severity: major Version: 3.0
Component: Import Keywords: needs-patch
Focuses: Cc:

Description

Hi there,

There is a bug when I tried to import from an XML files which had been generated by WP 2.9.2 to a WP 3.0 (version: 3.0-beta2-14550), which is always reproducible as follows:

After the import, there will be duplicated name, but different slugs. One same as the original slug in the WP 2.9.2 site, and the other same as the name itself.

For example, for the category: 游戏知识, two categories are created after importing:

1st
Name:游戏知识 Slug: knowledge

2nd
Name: 游戏知识 Slug: 游戏知识

The first one is the one I created in the original WP 2.9.2 site, and the 2nd one is the buggily created one. Unfortunately, all the posts are incorrectly filed under the 2nd one.

The same appies to the tags: duplicated tags are created with exactly same slugs as for categories and all the posts are filed under the incorrect tags.

The language for the WP 2.9.2 site: Simplified Chinese
The lauguage for the WP 3.0-beta site: English

I have attached the XML file which causes the bug within this thread. Hopefully someone will take care of it. Thanks for your time!

Daniel

Attachments (3)

wordpress.2010-05-08.xml (150.8 KB) - added by gaobo 15 years ago.
XML file exported from WP 2.9.2 site (Simplified Chinese) and causes trouble with categories and tags when imported to a WP 3.0-beta site (English).
imported_category_error.zip (44.6 KB) - added by gaobo 15 years ago.
The screenshot showing the incorrectness in the import logic (now it becomes a separated plug-in). I created a zipped file because the original BMP is much too big in size.
imported_category_error.png (27.9 KB) - added by nacin 15 years ago.
From reporter.

Download all attachments as: .zip

Change History (23)

@gaobo
15 years ago

XML file exported from WP 2.9.2 site (Simplified Chinese) and causes trouble with categories and tags when imported to a WP 3.0-beta site (English).

#1 follow-up: @demetris
15 years ago

  • Cc dkikizas@… added

This seems to be the same as #12813.

(The only difference being that the XML in this ticket was generated by WP v2.9, while the XML in #12813 was made with WP v3.0.)

#2 in reply to: ↑ 1 @gaobo
15 years ago

I don't think this one is exactly the same as the one in #12813.

Differences are:

  • The language of mine is Simplified Chinese, that of #12813's is Greek;
  • The categories incorrectly created in #12813 are with -num tails and each with 1 post filed under it but mine has no -num tails and all the files are filed under it: just with incorrect slug which is exactly the same as the name.

Thanks!

Replying to demetris:

This seems to be the same as #12813.

(The only difference being that the XML in this ticket was generated by WP v2.9, while the XML in #12813 was made with WP v3.0.)

#3 @ryan
15 years ago

Does importing into 2.9.2 have the same problem?

#4 follow-up: @ryan
15 years ago

If this is 3.0 specific, it may have been caused by #12349, which has been fixed.

#5 @demetris
15 years ago

I don’t know about this one, but #12813, the similar one that I mention above, was specific to 3.0 and seems to be fixed now. (I’m going to close it.)

#6 in reply to: ↑ 4 @gaobo
15 years ago

Replying to ryan:

If this is 3.0 specific, it may have been caused by #12349, which has been fixed.

It is 3.0 specific but it has not been resolved yet. I downloaded the latest nightly build, and it's still there. Please note that it was exported by 2.9.2 CHINESE and imported by 3.0 ENGLISH. Could that be the root cause?

#7 follow-up: @ryan
15 years ago

If the only difference between CHINESE and ENGLISH is the presence of a Chinese .mo file, then I don't think that would be a root cause.

#8 follow-up: @ryan
15 years ago

It's possible that the nightly build you used did not have the fix in question since you posted feedback 14 hours after that fix went in. I just forced a new nightly build to make sure the fix is in it. Could I trouble you to try again?

#9 in reply to: ↑ 7 @gaobo
15 years ago

I agree with you.

Replying to ryan:

If the only difference between CHINESE and ENGLISH is the presence of a Chinese .mo file, then I don't think that would be a root cause.

@gaobo
15 years ago

The screenshot showing the incorrectness in the import logic (now it becomes a separated plug-in). I created a zipped file because the original BMP is much too big in size.

#10 in reply to: ↑ 8 @gaobo
15 years ago

I tried again with a clean installation with the lastest build which may refer to the one you forced its creation. Unfortunately the error is still there. I uploaded another attachment of the zipped screenshot which may help clarify the problem to a better extent.

Thanks for your time looking into this!

Replying to ryan:

It's possible that the nightly build you used did not have the fix in question since you posted feedback 14 hours after that fix went in. I just forced a new nightly build to make sure the fix is in it. Could I trouble you to try again?

@nacin
15 years ago

From reporter.

#11 follow-up: @ryan
15 years ago

I can reproduce this in 2.9.2 as well. When importing posts, the category slug is not being referenced when checking to see if the category exists. This ends up in the category being recreated with a new slug. Instead of using this field:

<category><![CDATA[远征手记]]></category>

This field should be used:

<category domain="category" nicename="eternity"><![CDATA[远征手记]]></category>

And we should use the nicename as the slug when calling get_term_by() in the categories loop of process_post().

Since the importer is now in the plugins repo, this is not a blocker for 3.0 release. Fixing it would be very nice however. Anyone want to have a try?

#12 @nacin
15 years ago

  • Milestone changed from 3.0 to WordPress.org site

#13 in reply to: ↑ 11 ; follow-up: @gaobo
15 years ago

I suppose this to be a relatively important bug, since the first thing people usually do after deployment of 3.0 is to import their content from previous blogs as I did, and that's why I recognized the existence of the bug. However I agree that since the importer part has been moved into WORDPRESS.ORG we can move on and change its milestone, but having it fixed can provide many users of 3.0 with a better experience.

Replying to ryan:

I can reproduce this in 2.9.2 as well. When importing posts, the category slug is not being referenced when checking to see if the category exists. This ends up in the category being recreated with a new slug. Instead of using this field:

<category><![CDATA[远征手记]]></category>

This field should be used:

<category domain="category" nicename="eternity"><![CDATA[远征手记]]></category>

And we should use the nicename as the slug when calling get_term_by() in the categories loop of process_post().

Since the importer is now in the plugins repo, this is not a blocker for 3.0 release. Fixing it would be very nice however. Anyone want to have a try?

#14 in reply to: ↑ 13 @gaobo
15 years ago

  • Milestone changed from WordPress.org site to 3.0

The situation is more serious than it looks like. Importer seems to have been moved into WordPress.org site as a plug-in, but it turns out to be an essential part of WordPress 3.0 (or any future release). For WordPress 3.0, many people will perform the import action and it affects there user experience badly.

So, ryan or any buddies there, you have already found the root cause of the problem. So please take a few steps to have it resolved. I conducted a survey among my Chinese and Japanese friends, and 17 out of 20 of them complained about this issue. It shows a clear fact: THIS PROBLEM HURTS.

Let's work together to remove this tiny but important road blocker before shipping WordPress 3.0, thanks for all your time and efforts.

Replying to gaobo:

I suppose this to be a relatively important bug, since the first thing people usually do after deployment of 3.0 is to import their content from previous blogs as I did, and that's why I recognized the existence of the bug. However I agree that since the importer part has been moved into WORDPRESS.ORG we can move on and change its milestone, but having it fixed can provide many users of 3.0 with a better experience.

Replying to ryan:

I can reproduce this in 2.9.2 as well. When importing posts, the category slug is not being referenced when checking to see if the category exists. This ends up in the category being recreated with a new slug. Instead of using this field:

<category><![CDATA[远征手记]]></category>

This field should be used:

<category domain="category" nicename="eternity"><![CDATA[远征手记]]></category>

And we should use the nicename as the slug when calling get_term_by() in the categories loop of process_post().

Since the importer is now in the plugins repo, this is not a blocker for 3.0 release. Fixing it would be very nice however. Anyone want to have a try?

#15 follow-up: @nacin
15 years ago

  • Keywords needs-patch added; import duplicated entries removed
  • Milestone changed from 3.0 to WordPress.org site

This is not a blocker for release. With no patch, I would be inclined to move this to a future release, but given that the importers are in the plugins repository now, we can still handle this as part of its own release cycle, which presumably would be sooner.

#16 in reply to: ↑ 15 @gaobo
15 years ago

Still no updates on this? 3.0 has been released yet.

Replying to nacin:

This is not a blocker for release. With no patch, I would be inclined to move this to a future release, but given that the importers are in the plugins repository now, we can still handle this as part of its own release cycle, which presumably would be sooner.

#17 @nacin
15 years ago

Patches welcome :-)

#18 @Otto42
14 years ago

  • Milestone WordPress.org site deleted

#19 @Otto42
14 years ago

  • Milestone set to WordPress.org site

#20 @nacin
14 years ago

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

(In [15961]) Importer and exporter overhaul, mega props duck.

Exporter overhaul:

  • Add author information to export
  • Greater usage of slug identifiers
  • Don't export auto-drafts, spam comments, or edit lock/last meta keys
  • Inline documentation improvements
  • Remove filtering for now (@todo)
  • Bump WXR version to 1.1, but remain back compat in the importer

Importer overhaul (http://plugins.trac.wordpress.org/changeset/304249):

  • Use an XML parser where available (SimpleXML, XML Parser)
  • Proper import support for navigation menus
  • Many bug fixes, specifically improvements to category and custom taxonomy handling
  • Better author/user mapping

Fixes #5447 #5460 #7400 #7973 #8471 #9237 #10319 #11118 #11144 #11354 #11574 #12685 #13364 #13394 #13453 #13454 #13627 #14306 #14442 #14524 #14750 #15055 #15091 #15108.

See #15197.

Note: See TracTickets for help on using tickets.