Hello,

I'm trying those days to import a big list of nodes, and basically for each node imported I need to create a bunch of related nodes. So I am wondering if there is any build-in way to add a php logic after the import of a row, so I can get the id of the imported row and use it to create other nodes with reference to this imported node.

I had a look to the module and I don't think it does what I need out-of-the-box but where should I add my code php to do it ? Or is there any hook I can use ? Do I need to twick the module with caution regarding the php_limit for exemple ?

Great module BTW, thanks ;)

Comments

mtem27’s picture

You can use the below hook

function hook_node_import_postprocess($type, $values, $options, $preview) {
}

$values['nid'] will be available after the node is created

Robrecht Jacques’s picture

Component: Code » Documentation
Issue tags: +example use, +document hooks
Robrecht Jacques’s picture

Title: Add php logic after each row is added » API Info - Run PHP code after each row
avpaderno’s picture

Issue summary: View changes
Status: Active » Closed (outdated)
Issue tags: -example use, -document hooks

I am closing this issue, since it's for a Drupal version no longer supported.