• Hi,
    The problem I’m encountering is most likely a bug in wordpress, but I want to check with everyone here before filing one. The 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 title exists more than once in all the categories, there is no way to accurately determine which parent its 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”.

    If anyone can think of anything I’m missing, please let me know.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter sottenad

    (@sottenad)

    Note: for anyone looking for a quick fix (as I am), you can edit line #314 in wp-admin/includes/export.php from

    <wp:category><wp:category_nicename><?php echo $c->slug; ?></wp:category_nicename><wp:category_parent><?php echo $c->parent ? $cats[$c->parent]->name : ''; ?></wp:category_parent><?php wxr_cat_name( $c ); ?><?php wxr_category_description( $c ); ?></wp:category>

    TO

    <wp:category><wp:category_nicename><?php echo $c->slug; ?></wp:category_nicename><wp:category_parent><?php echo $c->parent ? $cats[$c->parent]->slug : ''; ?></wp:category_parent><?php wxr_cat_name( $c ); ?><?php wxr_category_description( $c ); ?></wp:category>

    Notice the change from “$cats[$c->parent]->name” to “$cats[$c->parent]->slug”

    Don’t edit core files unless you really, really, know what you’re doing. If you think you have found a bug and can replicate it when using Twenty Ten and no plugins, please post it in Trac.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Category Hierarchy Lost On Export/Import’ is closed to new replies.