Hi,

I imported a WP blog, all works fine but all comments are assigned to node 0.

I take a look to db, all coments have nid set to 0. I opened the wordpress_import.module, but i couldn´t see whats the problem.

Could anyone help me?

Thanks all and excuse my bad english, im from spain.

Comments

yrocq’s picture

Status: Active » Postponed (maintainer needs more info)

I can't reproduce this bug. Could you send me the xml file ?

roedelius’s picture

I have the same exact thing happening. Looking through the wordpress_import_post() function, I'm not 100% sure what's going on, but I can't find where $node->nid is actually defined or where it's coming from. wordpress_import_node_save() isn't using $node as a reference, and it's not returning anything... maybe it should? Could you verify that $node->nid is available when the comments are being saved (line 554 of 5.x-1.x)?

Thanks for writing this module!

roedelius’s picture

ok, I went ahead and changed wordpress_import_node_save($node) to wordpress_import_node_save(&$node) (on line 619) and it works now - comments have the correct $nid :)

Unrelated, sorry - I was getting php out of memory errors (client is on a shared host) after uploading a relatively small blog, I noticed it was filling up watchdog with PHP errors about html_entity_decode. I added '@' to the html_entity_decode function in question (line 489) and it fixed the out-of-memory issue (for me). FYI.

yrocq’s picture

roedelius> I commited your change on line 619 in CVS. This was a bug that occurs with PHP 4 and that I didn't see because I use PHP 5. Thanks.

Could you post here a copy of the html_entity_decode error, so that I can fix it too ?

Thank you very much for your feedback !

yrocq’s picture

Assigned: lahabichuela » yrocq
lavamind’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Branch 5.x is no longer supported.