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 ;)
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | wp_comment_inc.patch | 1.1 KB | szantog |
Comments
Comment #1
mikeryanThey 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?
Comment #2
MaxWesten commentedI 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.
Comment #3
mikeryanStrange - if you look in the database table field_data_comment_body, is the comment_body_value column empty?
Comment #4
MaxWesten commentedIt 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.
Comment #5
mikeryanAs maintainer, I'm always on the latest -dev.
Comment #6
MaxWesten commentedOk...
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 fieldsThen 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...
Comment #7
mikeryanAh-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.
Comment #8
mikeryanActually, try this, it should be the full correct fix:
Thanks.
Comment #9
szantog commentedI 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
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.
Comment #10
szantog commentedYeep, I wrote this more, than 20 minutes :)
Comment #11
MaxWesten commentedAwesome !
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!
Comment #12
jpincas commentedMike's fix in #8 worked perfectly for me to solve the problem. Great stuff!
Comment #13
mikeryanCommitted, thanks!