I'm attempting to import several hundred nodes as a CCK content type directly from a database. I've successfully populated the $node object with my data -- print_r($node) reveals that fact -- but I'm getting an error (repeated 10 times) when the script runs:
Warning: Invalid argument supplied for foreach() in /home/practice/public_html/drupal/modules/cck/content.module on line 375
It does seem to create a node, but the fields aren't populated with any data. I'm starting to panic since my deadline is approaching fast.
I've provided the code from the last part of my script, which is where I think the problem is.
Thanks in advance.
drb
//create node object with a row of data
global $user;
$node=(object)array(
'type' => 'content-opportunity',
'uid' => $user->uid,
'status' => 1, // Set to 0 if you do not want the content published
'promote' => 0, // Set to 1 if you do not want the content promoted to the front page
'sticky' => 0, // Set to 1 if you do not want the content sticky
'title' => $row[job_title],
'field_job_title' => $row[job_title],
'field_facility_name'=> $row[job_hospital],
'field_accepting_j1_visas' => $row[j1_visa],
'field_loan_assistance' => $row[loan_assistance],
'field_opportunity_overview' => $row[job_description],
'field_contact_persont'=> $row[contact_name],
'field_email_contact' => $row[contact_email],