Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#16153 closed defect (bug) (duplicate)

Duplicate Category Titles Breaks Hierarchy on Export/Import

Reported by: sottenad's profile sottenad Owned by: duck_'s profile duck_
Milestone: Priority: normal
Severity: normal Version: 3.0.4
Component: Export Keywords:
Focuses: Cc:


This issue is around how the export functionality handles hierarchical categories.

Since the wordpress exporter uses the "cat_name", or actual name of the parent category (not the slug/nicename) to define the category parent, if the same "cat_name" exists more than once in all the categories, there is no way for a child category to accurately determine which parent it's looking for.

For example: I make a category "Radios", and another category "TV's", and both of those categories have subcategories titled "Sony". The way the categories are related in the export file, there is no way of knowing if a category with a parent of "Sony" is a grandchild of "Radios" or "TV's".

Duplication instructions:

  1. Navigate to Posts -> Categories, in the WP-Admin panel of a fresh install of Wordpress 3.0.4.
  2. Create two new Categories, "Radios" and "Tv's"
  3. Create a new Category named "Sony", and make its parent "Radios"
  4. Create another new Category named "Sony", and make its parent "Tv's"
  5. Create a category named "Sony Radio", and make its parent the "Sony" that lives under "Radios"
  6. Create a category named "Sony TV", and make its parent the "Sony" that lives under "Tv's"
  7. Goto Tools -> Export, and click "Download Export File", using the default settings (each dropdown should say "All "+whatever)
  8. On a new, blank wordpress build, goto tools->import, then click the "wordpress" link and install the plugin needed to import.
  9. Import the file you just created in step 7

10 Visit Posts->Categories again, I see Only "Radios" and "TV's". Definitely not the structure I had exported

I would think that changing the <wp:category_parent> node to reference the "category_nicename" as opposed to the "cat_name" would clear the problem up.

Change History (3)

#1 @nacin
13 years ago

  • Keywords Categories Export Hierarchy Nesting removed
  • Owner set to duck_
  • Status changed from new to assigned

This may have been fixed in #15197 for 3.1.

#2 @duck_
13 years ago

  • Keywords reporter-feedback added

Haven't had time to double check to be 100% certain, but from your description this should be fixed with 3.1 and WordPress importer 0.3.

#3 @duck_
13 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Severity changed from critical to normal
  • Status changed from assigned to closed

Confirmed fixed with trunk core and importer. Marking dupe of #15197.

Note: See TracTickets for help on using tickets.