WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#5555 closed defect (bug) (fixed)

Post Excerpts not included in import/export

Reported by: intricateartist Owned by:
Milestone: 2.6 Priority: normal
Severity: major Version:
Component: General Keywords: has-patch tested dev-feedback
Focuses: Cc:

Description

Helli (a member in the forum) posted the fix for this bug in the forum 10 months ago for version 2.1 - this should be added to the list of bugs/defects for the next release:

Add in wp-admin\export.php:

<excerpt:encoded><![CDATA[<?php echo $post->post_excerpt ?>]]></excerpt:encoded>

above:

<content:encoded><![CDATA[<?php echo $post->post_content ?>]]></content:encoded>

and in wp-admin\import\wordpress.php:

below:

$post_author = $this->get_tag( $post, 'dc:creator' );

place:

$post_excerpt = $this->get_tag( $post, 'excerpt:encoded' );
$post_excerpt = str_replace(array ('<![CDATA,?]>'), , $post_excerpt);
$post_excerpt = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_excerpt);
$post_excerpt = str_replace('<br>', '<br />', $post_excerpt);
$post_excerpt = str_replace('<hr>', '<hr />', $post_excerpt);

(above this line)

$post_content = $this->get_tag( $post, 'content:encoded' );

Attachments (1)

wpexcerpt.patch (1.4 KB) - added by kartik_subbarao 7 years ago.
Enable proper import/export of blog excerpts

Download all attachments as: .zip

Change History (8)

comment:1 @ryan7 years ago

Fine by me. Anyone want to create a patch?

comment:2 @kartik_subbarao7 years ago

Are you looking for a specific patch in "diff -u" format? The original poster did specify the code changes necessary. If the only thing holding this back is the format of the code patch, that can certainly be provided pretty quickly.

@kartik_subbarao7 years ago

Enable proper import/export of blog excerpts

comment:3 @kartik_subbarao7 years ago

I have submitted a patch (see the attachment). I was able to omit one of the lines that stripped out <![CDATA[]>, since that gets done elsewhere already.

comment:4 @error7 years ago

  • Keywords has-patch tested dev-feedback added

Confirmed. I just got burned by this bug and I'm surprised it's been around this long.

comment:5 @ryan7 years ago

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

(In [7965]) Export and import post excerpts. Props kartik_subbarao. fixes #5555

comment:6 @intricateartist7 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

This fix no longer works in 2.6.2 - and import/export of post excerpts is still not included in the function.

comment:7 @DD327 years ago

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

according to the export file: http://trac.wordpress.org/browser/tags/2.6.2/wp-admin/includes/export.php#L204 the excerpt was included as per [7965], reclosing as fixed.

Note: See TracTickets for help on using tickets.