i am able to export comments with no problem, however when i try to import them i get the following error "comment" does not have entity field base processor defined.

I have tried to find where to define this base processor but am hitting a wall, any help would be appreciated.
Thanks,
Jose

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

joekings created an issue. See original summary.

abramm’s picture

Assigned: Unassigned » abramm
Category: Bug report » Feature request

You're right, comments aren't currently supported. I'll check what's needed to add support.

abramm’s picture

I've pushed an initial boilerplate for the Comments entity type support class.
A challenging part would be exporting references to the parent Node (which should already exist in the system) and a reference to the parent comment (which should already exist as well).

As an option, we could add a setting to export the Node with all of its child Comments, but that could not work if there're a lot of comments for the node.

Keeping this open for now.

joekings’s picture

Thanks, just tried it, export worked again, had a different output than when i tried it yesterday, but am getting an error on import
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'entity_type'
> cannot be null

abramm’s picture

Version: 1.4.4 » 1.4.x-dev

Hi joekings,
Sorry if I haven't been clear, the PR is not ready for testing. It's just some basic sceleton code.

abramm’s picture

Title: comments import not working » Comments import not working
Issue tags: +LutskGCW24
leeksoup’s picture

@abramm - is there any update to this feature? I have a need to sync specifically comments in the Forum module, but I think the comment entities are the same as any other comments in Drupal.

Looking at one of my comment entities, I see that this is its data structure:

array:20 [▼
  "cid" => array:1 [▶]
  "uuid" => array:1 [▶]
  "langcode" => array:1 [▶]
  "comment_type" => array:1 [▶]
  "status" => array:1 [▶]
  "uid" => array:1 [▶]
  "pid" => []
  "entity_id" => array:1 [▶]
  "subject" => array:1 [▶]
  "name" => []
  "mail" => []
  "homepage" => []
  "hostname" => []
  "created" => array:1 [▶]
  "changed" => array:1 [▶]
  "thread" => array:1 [▶]
  "entity_type" => array:1 [▶]
  "field_name" => array:1 [▶]
  "default_langcode" => array:1 [▶]
  "comment_body" => array:1 [▶]
]

Which of these fields needs to be mapped in the Comment.php plugin?

leeksoup’s picture

Re #4

As an option, we could add a setting to export the Node with all of its child Comments, but that could not work if there're a lot of comments for the node.

How difficult would it be to do this option? I don't have a lot of comments per node so this might work for me.

nginex’s picture

Status: Active » Closed (duplicate)
Related issues: +#3478941: creating a comment exporter plugin

All the work should happen in #3478941: creating a comment exporter plugin