WordPress.org

Make WordPress Core

Opened 12 years ago

Closed 10 years ago

#12871 closed enhancement (fixed)

Comment meta lost on Export/Import

Reported by: Otto42 Owned by: duck_
Milestone: 3.2 Priority: normal
Severity: normal Version: 3.0
Component: Export Keywords: 2nd-opinion has-patch
Focuses: Cc:

Description

When doing a blog export and import, comment meta information is not preserved.

Observed in 2.9.2 and 3.0 B1.

Attachments (5)

export.diff (969 bytes) - added by kapeels 11 years ago.
Patch.
importer.diff (8.0 KB) - added by kapeels 11 years ago.
Patch for the plugin.
importer-0.4.diff (5.2 KB) - added by oreio 11 years ago.
Patch updated to apply in plugin version 0.4
12871.export.diff (1.9 KB) - added by duck_ 11 years ago.
12871.importer.diff (4.0 KB) - added by duck_ 11 years ago.

Download all attachments as: .zip

Change History (14)

#1 @nacin
11 years ago

  • Keywords needs-patch added
  • Type changed from defect (bug) to enhancement

#2 @nacin
11 years ago

  • Milestone changed from Awaiting Review to 3.1
  • Owner set to duck_
  • Status changed from new to assigned

#3 @jane
11 years ago

  • Milestone changed from 3.1 to Future Release

Where is the has-patch?
This ticket has been sitting.
Sad Christmas. Now, punt.

@kapeels
11 years ago

Patch.

@kapeels
11 years ago

Patch for the plugin.

#4 @kapeels
11 years ago

  • Cc kapeel.sable@… added
  • Keywords 2nd-opinion has-patch added; needs-patch removed

As of now, the patch works with SimpleXML, XML and regex(all three!).

@oreio
11 years ago

Patch updated to apply in plugin version 0.4

#5 @oreio
11 years ago

  • Cc oreio added

kapeels patch worked fine for me, thanks! WordPress 3.1.1 with WordPress Importer 0.4.

I've imported 250 comments with two custom fields each, and it all went fine.
I did not tested the export, since I'm generating the XML from a script.

I had to apply the patch "by hand", as the plugin code changed since than. I've just attached the updated version for the importer patch, ready to be applied in plugin version 0.4. I did not change any code from kappels patch, just formatting and line location.

@duck_
11 years ago

#6 follow-up: @duck_
11 years ago

  • Milestone changed from Future Release to 3.2

Attached slightly reworked patches. Mainly to allow re-use of <wp:meta_(key|value)> tags instead of introducing new, redundant tags for the same purpose. If it weren't for back compat I would go with <wp:meta> for both postmeta and commentmeta too.

Removed some if statements after queries for export since get_results() will always return an array which is fine for the foreach.

Also removed the filter and action for insertion in the importer. Can be reintroduced if there is a use, but don't see a point in just adding them because postmeta has them. The filter to allow disabling certain keys might make more sense, but the action is unnecessary (see added_{$meta_type}_meta).

#7 in reply to: ↑ 6 @duck_
11 years ago

Replying to duck_:

Also removed the filter and action for insertion in the importer. Can be reintroduced if there is a use, but don't see a point in just adding them because postmeta has them. The filter to allow disabling certain keys might make more sense, but the action is unnecessary (see added_{$meta_type}_meta).

Also filter on key seems unnecessary, see add_{$meta_type}_metadata in add_metadata().

#8 @ryan
11 years ago

(In [17700]) Export commentmeta. Props duck_. see #12871

#9 @ryan
10 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.