Opened 3 years ago

Closed 2 years ago

#12871 closed enhancement (fixed)

Comment meta lost on Export/Import

Reported by: Otto42 Owned by: duck_
Priority: normal Milestone: 3.2
Component: Export Version: 3.0
Severity: normal Keywords: 2nd-opinion has-patch
Cc: kapeel.sable@…, oreio

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 2 years ago.
Patch.
importer.diff (8.0 KB) - added by kapeels 2 years ago.
Patch for the plugin.
importer-0.4.diff (5.2 KB) - added by oreio 2 years ago.
Patch updated to apply in plugin version 0.4
12871.export.diff (1.9 KB) - added by duck_ 2 years ago.
12871.importer.diff (4.0 KB) - added by duck_ 2 years ago.

Download all attachments as: .zip

Change History (14)

  • Keywords needs-patch added
  • Type changed from defect (bug) to enhancement
  • Milestone changed from Awaiting Review to 3.1
  • Owner set to duck_
  • Status changed from new to assigned

comment:3   jane2 years ago

  • Milestone changed from 3.1 to Future Release

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

kapeels2 years ago

Patch.

kapeels2 years ago

Patch for the plugin.

  • 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!).

oreio2 years ago

Patch updated to apply in plugin version 0.4

  • 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_2 years ago

duck_2 years ago

comment:6 follow-up: ↓ 7   duck_2 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).

comment:7 in reply to: ↑ 6   duck_2 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().

comment:8   ryan2 years ago

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

comment:9   ryan2 years ago

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