Hmmm for some reason the comment_body isn't migrated.
Just before the comment_save the in the WordPressCommentSource->prepare function, the comment_body is filled, it doesn't show up in the migrated comments however.
I could use a nudge in the right direction ;)

CommentFileSizeAuthor
#9 wp_comment_inc.patch1.1 KBszantog

Comments

mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

They definitely appear to me. If you edit a comment from /admin/content/comment, is the text visible there? I do see that it's not applying the selected text format to comments, for me it ends up defaulting to plain text and displaying fine but maybe you have a different default filter. Do you have any additional comment-related modules enabled that might be having an effect?

MaxWesten’s picture

I get all comments imported and see them in the backend.
If I edit a comment, the body is empty.

There are no other comment related modules enabled.

mikeryan’s picture

Strange - if you look in the database table field_data_comment_body, is the comment_body_value column empty?

MaxWesten’s picture

It is.
And if I just add a comment manually it just works....
Tried to get my head around it and it's driving me nuts.... (I should probably read a bit more on the new entity and field specs to grok it... ;))
What are the exact versions of Migrate and WP_migrate you use ? (I'll update to those versions then)

Thanks again.

mikeryan’s picture

As maintainer, I'm always on the latest -dev.

MaxWesten’s picture

Ok...
uninstalled the installed versions of migrate and WP migrate and installed both dev version I just downloaded.
Enabled the modules and went to the /admin/content/wordpress page. Configured the settings and imported the WXR file.
It says it imported correctly.

Now visiting the /admin/content/comments page gives a lot of warnings:
Notice: Undefined index: und in comment_admin_overview() (line 108 of /Users/mwesten/Sites/drup7max/dlmax/modules/comment/comment.admin.inc).

If I go to the admin/content/migrate page, it states it imported 65 of the 68 comment an that 3 error occurred. Entering the comment-details here (in my case: /admin/content/migrate/DLMaxComment ) it shows me the warning comment_body used as destination field in mapping but not in list of destination fields

Then looking at /admin/structure/types/manage/blogpost/comment/fields to see what the filednames are and the name is "comment_body".

Can't really see where things go awry...

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Active

Ah-ha! Your post content type is blogpost, but I'm afraid the comment migration is hardcoded to blogs. See line 75 of wordpress_comment.inc, if you change the value to 'comment_node_blogpost' does it work for you? Assuming so, I'll fix it to use the configured post destination type...

Thanks.

mikeryan’s picture

Status: Active » Needs review

Actually, try this, it should be the full correct fix:

    $arguments['post_type'] = 'comment_node_' . variable_get('wordpress_migrate_post_type', '');;

Thanks.

szantog’s picture

Status: Needs review » Postponed (maintainer needs more info)
StatusFileSize
new1.1 KB

I don't know _exactly_, what I did, but it seems, I figured out, whats the problem.
And again, i don't understand exactly, how this migrate works, but i see, the comment_body isn't defined.
In migrate example, the comment construct schema has

      'body' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'description' => 'Comment body',
      ),

and when $this->destination = new MigrateDestinationComment('comment_node_migrate_example_beer'); is called the destination field body is created in admin/content/migrate page

My soultion was this: in wordpress.comment.inc I use $arguments['bundle'] = 'comment_node_' . variable_get('wordpress_migrate_post_type', ''); where the comment_node_blog_post is my bundle of field_data_comment_body table, and use this: $this->destination = new MigrateDestinationComment($arguments['bundle']) to create destinations, and I got all fields used in blog_post contenttypes comments.

And here is a patch, I really don't know, it's good, but it works.

szantog’s picture

Status: Postponed (maintainer needs more info) » Needs review

Yeep, I wrote this more, than 20 minutes :)

MaxWesten’s picture

Awesome !

Working like a charm; both solutions(#7 and #8), but put the last(#8) in.
I must have looked multiple times at that line... *g*

Thanks Mike!

jpincas’s picture

Mike's fix in #8 worked perfectly for me to solve the problem. Great stuff!

mikeryan’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.