import of comments does not work
writes after trying to import

"Failed importing Default comments."

Feeds Version: 8.x-3.0-alpha4
Drupal 8.5.4 ana 8.6.10

Comments

zeroif created an issue. See original summary.

MegaChriz’s picture

Importing comments is something that I did not test.

Do you want to investigate why the import fails? Patches are welcome too.

zeroif’s picture

yes, how much

MegaChriz’s picture

Priority: Critical » Minor
btown’s picture

Importing comments does not work for me either. Sorry my developer skills are limited or I would help to debug. Here's a couple of things I noticed from trying different things in the UI:

I had to include a field in the source CSV file for field_name that included my username. In earlier versions of Feeds, this could be handled by the settings of the feed. There is a field for "owner" under processor settings, but it doesn't seem to be related.

I also had to include a field in the source for entity_type, which I populated with "node."

This cleared two of the error messages I was getting and the comments did import, but when trying to view/edit an imported comment I got "The website encountered an unexpected error. Please try again later."

Also, I noted when mapping fields that "entity_id" was needed, but can only reference entities by "name" not their actual ID's.

Finally, I was unsuccessful at importing a multi-value field (entity reference where multiple taxonomy terms are permitted)

Feeds: 8.x-3.0-beta1
Core: 9.4.2

plusproduit’s picture

Hello btown,

I had the same problem, I solved it by populating the field:
Comment field name (field_name): The field name through which this comment was added.
In my case, I used field_discussion.

Hope that helps.

blogchef12’s picture

I am also having this same issue. The comments appear to be imported into the correct products but they do not show up on the Product page and I get this error when trying to edit any of them. I believe the problem is in field_name. What is the value that is supposed to be mapped to that field? Using Drupal 10 and feeds 8.x-3.0-beta4.

and this is what I get when I click the edit button next to one of these feeds imported comments, field_text in this case is what I have mapped field_name to...

Warning: Undefined array key "field_text" in Drupal\comment\CommentForm->form() (line 95 of core/modules/comment/src/CommentForm.php).
Drupal\comment\CommentForm->form(Array, Object) (Line: 107)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('comment_cchi_comments_form', Object) (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)

Edit: I did figure this out I had to use the value 'field_comments' from looking in the database table for comments.