Hello,

Great module!

In my CSV I have a few situations where I have multiple columns that need to be concatenated into one CCK field on my node. An example is:

CSV Columns: Area Code, Phone Number
Node Field: Phone Number (including area code)

At first I thought this would be easy enough to do in hook_import_node_import_prepare(), I can just massage the data how I need. However, there is a problem in that I only have access to the $node variable in that hook. Is there any way to get the current CSV Row data in this hook? Or some other way to go about doing this? That way I could just say something like:

$node->phone = $row['area_code'] . $row['phone'];

The only way I can figure to do this is to create a hidden field for each CSV field I need access to but is not mapped to a node field directly. I would then have the data available to me in $node. This would work, but I don't want a bunch of hidden fields on my node just to make the import work if I can at all avoid it. Any ideas on how I can get this working? Perhaps I just need a nudge in the right direction. Thanks a lot.

CommentFileSizeAuthor
#2 node_import_271844b.patch1.79 KBKingMoore

Comments

KingMoore’s picture

dp.

KingMoore’s picture

Status: Active » Needs review
StatusFileSize
new1.79 KB

This patch does what I want, giving access to $row in hook_node_import_prepare. What do you think?

ajason98’s picture

Is there anything like this for drupal 6?