After mapping csv fields to cck node, I receive this php error when I press "Next (options)" button:

Fatal error: Cannot use string offset as an array in pathtomodule/node_import/supported/cck/content.inc on line 200

Drupal 5.3
php5

Comments

velo_dev’s picture

I'm receiving the exact same error message. Also using Drupal 5.3 and php5. Help?

oliveyrc’s picture

StatusFileSize
new1.15 KB

I had the same problems here, I had a little play around and this its something to do with importing blank fields, so I've added a quick check before assigning the value to the field, see the line $temp = (!empty......

For a full function swap out have a look at the attached file.

The only other suggestion I would add is maybe do an ini_set on execution time as I'm importing 6000+ nodes from a CSV and its timing out!

Hope that helps

Richard

velo_dev’s picture

Excellent, your solution worked perfectly! Thank you.

number2’s picture

Richard, your patch worked for me! Thanks.

anantagati’s picture

Status: Active » Needs review
StatusFileSize
new1.08 KB

Created patch from #2.

anantagati’s picture

Working for me except "User Reference" field. When field is "User Reference" it doesn't fill user id and field refers to Anonymous user.

anantagati’s picture

Title: php: Fatal error » Problem with import of CCK fields
Category: support » bug
Status: Needs review » Needs work
oliveyrc’s picture

Thanks for rolling the patch, I was having trouble setting up my dev environment, I'll have a look at this issue for you too,

Edit - I've Just looked at this, and I'm not seeing anything wrong, maybe I can't see the wood for the trees, By this do you mean 'step 3', Under node options -> Authored By? I imported as my admin uber user '1' and imported, then checked Administer->Content Management->content and filtered to the CCK type I imported and the Author is listed as Admin and not anonymous.

If you could shed some light on it that would be grand.

Rich

anantagati’s picture

My CCK node has title, body and two additional fields: Integer (from number.module) and User Reference (from userreference.module). Both modules are under CCK module directory.

When I import CSV file with 4 collumns (title, body, number, user id). Integer field type is filled correctly, but User Reference field is not set.
When I swap columns from CSV file for number and user reference, again number is filled and user reference again empty.

wmostrey’s picture

Status: Needs work » Reviewed & tested by the community

I had the exact same issue as described in OP and the patch in #5 fixed it for me. I'd say this patch can be committed and a new issue is created for the "User Reference" problem. There is also already a "Node Reference" issue.

Robrecht Jacques’s picture

Status: Reviewed & tested by the community » Fixed

Committed to the DRUPAL-5 branch. It will be included in the 5.x-1.3 release when that will be released. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

hgreer’s picture

Great patch oliveyrc! Thanks a million! I ran across this issue while trying to import a .csv file containing information for over 600 nodes. Your patch worked beautifully.