[wp-trac] [WordPress Trac] #10619: Importing WXR breaks serialized postmeta value

WordPress Trac wp-trac at lists.automattic.com
Wed Aug 19 02:49:56 UTC 2009


#10619: Importing WXR breaks serialized postmeta value
----------------------------+-----------------------------------------------
 Reporter:  JonathanRogers  |       Owner:       
     Type:  defect (bug)    |      Status:  new  
 Priority:  normal          |   Milestone:  2.9  
Component:  Import          |     Version:  2.8.4
 Severity:  normal          |    Keywords:       
----------------------------+-----------------------------------------------

Comment(by JonathanRogers):

 Replying to [comment:2 westi]:
 > Not sure this is the best solution here.
 >
 > May be better to unserialise and pass to add_meta as that is what it
 expects.

 You mean it may be better to unserialize every custom field value when
 importing? Is it correct to unserialize values that aren't serialized?

 I don't think my solution is the best either. I think that either
 add_post_meta() shouldn't pass the value through maybe_serialize() or
 maybe_serialize() shouldn't serialize values that are already serialized.
 What's the value of serializing something twice? However, I didn't do that
 because the comments on maybe_serialize() implied that there was some
 reason for its bizarre and extremely surprising behavior.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10619#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list