WordPress-Importer icon indicating copy to clipboard operation
WordPress-Importer copied to clipboard

upon import term->parent is not correct

Open pbiron opened this issue 8 years ago • 6 comments

Non-empty <wp:category_parent> and <wp:term_parent> elements are not processed correctly. As a result, all imported terms have term->parent == 0.

pbiron avatar Jun 14 '17 18:06 pbiron

I've got a fix for this but can't yet submit a PR for it until the Simple namespace-aware parsing PR is merged because the fix for this relies on the unit tests I added in that PR.

pbiron avatar Jun 14 '17 18:06 pbiron

I too have encountered this problem and have added a PR that addresses the underlying issue: https://github.com/humanmade/WordPress-Importer/pull/129

@pbiron Please take it for a test drive and see if it fixes the issue for you.

dcavins avatar Jun 22 '17 20:06 dcavins

@dcavins Glancing thru the changes in your PR it looks like your fix is more complete than mine (one of these days I'll wrap my head around the $this->mapping and post_process_xyz() code in this plugin).

I'll give yours a try when I get a chance and report back.

pbiron avatar Jun 22 '17 20:06 pbiron

Thanks @pbiron. I had to do some digging to understand what's going on with the term import, too. Basically, the $exists array is meant to be a cache to avoid a million individual MySQL queries for terms. I opened a new issue about some thoughts on the exists and mapping arrays here: https://github.com/humanmade/WordPress-Importer/issues/130

dcavins avatar Jun 22 '17 21:06 dcavins

@dcavins I just had a chance to review your PR and it passed all the tests I wrote for it. So, hopefully, it'll get merged soon.

pbiron avatar Jun 24 '17 15:06 pbiron

@pbiron Thanks for testing this PR out. It's great to have another pair of eyes look at it, and I love it when somebody's got tests to apply. 👍

dcavins avatar Jun 26 '17 13:06 dcavins