[wp-trac] [WordPress Trac] #36818: Export filter for post meta

WordPress Trac noreply at wordpress.org
Mon May 16 23:54:16 UTC 2016


#36818: Export filter for post meta
-----------------------------------------+------------------------------
 Reporter:  justinbusa                   |       Owner:
     Type:  enhancement                  |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Export                       |     Version:
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch reporter-feedback  |     Focuses:
-----------------------------------------+------------------------------

Comment (by justinbusa):

 Hey @dd32, thanks for following up on this!

 TBH, I've dug through this more than I'd like to admit and am having a
 really tough time finding out what is causing the corruption of the
 serialized meta values.

 At first, I thought it was something to do with the importer, but after
 further testing, I'm not 100% sure that it's not something with the
 export.

 To give you some context as to how the data is built/saved...

 The arrays are built based on user input (such as text or HTML entered in
 an editor). Once the arrays are ready to be saved/serialized, we do that
 using the `update_metadata` function (which serializes them for us).

 We're not really doing anything special and are letting WordPress handle
 the heavy lifting when it comes to serializing, saving, exporting, and
 importing.

 My guess is that it's some sort of encoding or special character that's
 changing during the transaction and breaking the length of the serialized
 data.

 I've tried base64 encoding the exported meta and decoding the import and
 it fixed the issue. However, I'm not entirely sure if that's a solution or
 not.

 I've attached a copy of an export with this issue. The post meta works
 when pulled from the database and unserialized on the source site, but it
 won't import into another site.

 Any ideas you may have regarding the corruption of serialized data during
 export/import would be extremely helpful as I've been spinning my wheels
 on this one for a while.

 Thanks!

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36818#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list