I'm trying to import the connection for this comment to a node, but the node id has changed when importing from one drupal site to another. In that case, can I map the Node title instead of the Node ID with this comment? The node ID changes depending on the content import steps. Since I'm importing the comments last, the Nid won't match the one that's on the original, but the title of the node should match. Is it possible to map it with the node title instead of the node ID ?

Comments

goldlilys’s picture

Title: How to attach to correct node when node ID is different from source to destination? » How to attach the correct node when node ID is different from source to destination?
goldlilys’s picture

Was able to create a script to output a csv file matching the old node id with the new one. But when I tried importing, I keep receiving this error

Unable to create comment with empty NID.

I do have the nid mapped to the new NID, but unsure why it can't find it? Which fields are needed to map the NID correctly?

twistor’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Component: Miscellaneous » Code
Assigned: Unassigned » twistor
Category: Support request » Feature request

Mapping to the node title should definitely be possible. It's not at the moment.

If the nodes are also being imported by feeds, you can use the 'Node ID by GUID" mapping target.

twistor’s picture

Status: Active » Needs review
StatusFileSize
new5.98 KB

  • twistor committed 496e5cd on 7.x-1.x
    Issue #2477165 by twistor: How to attach the correct node when node ID...
twistor’s picture

Assigned: twistor » Unassigned
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

szy’s picture

@twistor, thanks a lot for the patch.

However, I get "Unable to create comment with empty NID." error.

Should I map a title of the commented node to a nid_by_title field or to something else?

Szy.