[wp-trac] Re: [WordPress Trac] #8019: WXR import incorrectly
handles comment ID's, Results in threading being lost
WordPress Trac
wp-trac at lists.automattic.com
Tue Jun 2 07:37:51 GMT 2009
#8019: WXR import incorrectly handles comment ID's, Results in threading being
lost
--------------------------+-------------------------------------------------
Reporter: DD32 | Owner: joostdevalk
Type: defect (bug) | Status: assigned
Priority: high | Milestone: 2.8
Component: Import | Version: 2.7
Severity: major | Keywords: has-patch needs-testing commit
--------------------------+-------------------------------------------------
Changes (by Denis-de-Bernardy):
* keywords: has-patch needs-testing => has-patch needs-testing commit
Comment:
IRC discussion for reference:
{{{
[09:30] <jdevalk> basically threw all comments into an array, sort them by
id, remapped the wxr id's to the new id's and attach the correct parent
[09:31] <jdevalk> also working on a plugin that let's you import wxr files
that are on the server, so you're not capped by HTTP upload restraints
[09:31] <ddebernardy> I take it you tested before/after with your data
already, no?
[09:31] <jdevalk> yes.
[09:33] <ddebernardy> patch's logic seems correct
[09:33] <jdevalk> yeah it's not too hard
[09:34] <ddebernardy> an alternative method, which might be more robust,
could be re-key the comments array based on parents
[09:34] <ddebernardy> array ( comment_parent => comments )
[09:34] <ddebernardy> and then do a double foreach loop
[09:34] <jdevalk> not sure i follow? :)
[09:35] <ddebernardy> well, it would cover the case where a weirdo plays
with his database
[09:35] <ddebernardy> and ends up with comment IDs in an order than hasn't
much to do with the comments date or hierarchy
[09:35] <ddebernardy> but it's such an edge case that we can ignore it imo
[09:36] <jdevalk> yeah i think so too
}}}
Safe to commit imo.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/8019#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list