torchbox / wagtail-wordpress-import

A package for Wagtail CMS to import WordPress blog content from an XML file into Wagtail
MIT License
44 stars 16 forks source link

Fix wp_post_meta content #102

Closed nickmoreton closed 3 years ago

nickmoreton commented 3 years ago

Fix wp_post_meta content

The last merge has caused an issue that wp_post_meta no longer contains required fields for import hooks.

I'm adding test to highlight the issue first then add in a fix for the clean_wp_post_meta() method.

The problem was that we altered clean_wp_post_meta() to only save wp:postmeta data. We needed to also be saving all other data for an XML item tag. With the exception of content:encoded.

I've altered the clean_wp_postmeta() to also include some improvements to dealing with removing leading `and replacing:` charachters.

Ticket URL:


nimasmi commented 3 years ago

Thanks for making the code changes, @nickmoreton. I'll leave it up to you for how or whether to resolve the docs example issue. I now approve this PR.