Make WordPress Core

Opened 16 years ago

Closed 15 years ago

#8840 closed defect (bug) (fixed)

WRX Import does not import category description

Reported by: ose's profile ose Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.7
Component: Import Keywords: has-patch tested commit
Focuses: Cc:

Description

When exporting a wordpress blog, category descriptions are stored in the resulting XML file. However, upon import, they are not re-imported. As such a full-circle export-import is not possible.

While the default theme does not use category descriptions, other themes do use it and this bug does limit the usefulness of the import feature. This has been reported by others in the support forums in the past (http://wordpress.org/support/topic/175488 and http://wordpress.org/support/topic/150223).

This is also a problem when migrating from another blog system or CMS (in my case) via WXR files.

To reproduce:
Create a category with a description in wordpress
Export to WRX file
Import WRX file into empty blog.

Result: Category will be imported, but category description will be missing.

Attachments (1)

8840.diff (939 bytes) - added by Denis-de-Bernardy 15 years ago.

Download all attachments as: .zip

Change History (9)

#1 @ose
16 years ago

It seems like there is an easy patch for this:

In wp-admin/import/wordpress.php,

function process_categories() {
...
$category_nicename = $this->get_tag( $c, 'wp:category_nicename' );
$category_description = $this->get_tag( $c, 'wp:category_description' );
...
catarr = compact('category_nicename', 'category_parent', 'posts_private', 'links_private', 'posts_private', 'cat_name', 'category_description');

...

I tried this in a local install and it works fine for me by adding the extra line and adding category_description to the compact call.

Can someone please verify and possibly apply this patch?

#2 @ose
16 years ago

  • Keywords xml categories added
  • Milestone 2.8 deleted

#3 @Denis-de-Bernardy
15 years ago

  • Keywords needs-patch needs-testing added; wrx import xml categories removed
  • Milestone set to 2.8

#4 @Denis-de-Bernardy
15 years ago

  • Keywords has-patch added; needs-patch removed

#5 @Denis-de-Bernardy
15 years ago

patch is as described above. needs some testing.

#6 @demetris
15 years ago

  • Cc dkikizas@… added
  • Keywords tested added; needs-testing removed

Tested once against r11238 and it worked fine.

#7 @Denis-de-Bernardy
15 years ago

  • Keywords commit added

#8 @ryan
15 years ago

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

(In [11321]) Import category descriptions. Props Denis-de-Bernardy. fixes #8840

Note: See TracTickets for help on using tickets.