I have succesfully imported a large blog, everything went ok.

But the comment_counts variable in node.tpl.php states 0. After I add a new comment to the thread it does count the comments correctly. It seems that the comment count needs to be regenerated,

after cache flush and cron it shows no difference,

thank!

Comments

nuez’s picture

It seems that anonymous users cant see the comments, maybe i´ve posted this one to soon..

nuez’s picture

so, its still not clear to me: my comments are published, but not visible for anonymous'... checked permissions, but nothing there.

, maybe this should be a support request, i get the feeling i just can´t find the right button to click.

mikeryan’s picture

Title: $comment_count = 0 » Migrated comments not visible to anonymous users
Project: WordPress Migrate » Migrate

Step one is make sure anonymous users have the "View comments" permission. But, there seems to be more to it than that - I did reproduce the fact that the comments weren't visible, until a manual comment was added. Commented out the code in Migrate that delays updating node_comment_statistics till the end and reran the migration, and all went fine, so that seems to be where the issue is...

mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

Well, circling back to try to fix it, and now I can't reproduce it - is anyone still seeing this with Migrate 2.3 or later? Any specific steps to reproduce?

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
mikeryan’s picture

Status: Closed (cannot reproduce) » Active

Reported anew at #1649438: Comments missing from node page, need to try this again...

mikeryan’s picture

Ha! I think I've got it... On a current project, I'm migrating two blogs, one with 6482 comments and one with 174214 comments. The first one works fine - the second fails with the seemingly non-sequitur error

Notice: Undefined property: v?<::$?d?7 ?vC{ in /mnt/www/html/myproject/docroot/includes/stream_wrappers.inc on line 549

This happens when the migration is apparently done, and all comments are clearly migrated, so I hadn't gotten around looking too closely at it since it seemed so freakish. But, I understand now - in MigrateDestinationComment::postImport(), we're trying to rebuild the statistics in basically one massive SQL query, and its blowing up. Why we get what looks like memory corruption rather than a rational MySQL error message is beyond me, but we need to either break down that query to one query per node, or abandon the optimization and let the statistics update during migration.

mikeryan’s picture

Well, actually, there's an issue with wordpress_migrate here, the base wordpress class postImport() not calling parent::postImport(), so the comment count fixup doesn't happen - it's a mystery to me how my small blog appeared to get its comment counts, though...

mikeryan’s picture

Status: Active » Closed (cannot reproduce)

I can't reproduce this with the latest Migrate code - closing, we can revisit if it pops up again.