Import comments error

lahabichuela - April 26, 2008 - 20:14
Project:Wordpress Import
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:critical
Assigned:yrocq
Status:postponed (maintainer needs more info)
Description

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.

#1

yrocq - May 4, 2008 - 00:02
Status:active» postponed (maintainer needs more info)

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

#2

roedelius - June 4, 2008 - 21:01

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!

#3

roedelius - June 4, 2008 - 21:25

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.

#4

yrocq - June 7, 2008 - 23:22

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 !

#5

yrocq - June 7, 2008 - 23:22
Assigned to:lahabichuela» yrocq
 
 

Drupal is a registered trademark of Dries Buytaert.