I'm trying to create feed nodes by importing a csv file. I should mention I have added one text CCK field to the feed node.

My csv file has the fields url;homepage;title;publishers;subjects where the latter two are taxonomy fields. My feed importer is cloned from Node import. the url field from csv is mapped to URL for the feed node.

When I do the import, I get the following errors (one per imported node):

# warning: array_merge() [function.array-merge]: Argument #2 is not an array in /path/sites/all/modules/feeds/includes/FeedsConfigurable.inc on line 124.
# warning: array_intersect_key() [function.array-intersect-key]: Argument #1 is not an array in /path/sites/all/modules/feeds/includes/FeedsConfigurable.inc on line 126.

The feed nodes do get created but the url field stays blank. If I try to edit the feed node manually and set the url field, it reverts to blank after I save the node, and I get the same "not an array" error messages.

I'm not sure this is a great idea, but using the examples from http://drupal.org/node/36408#comment-354218, I can get rid of those warnings by adding (array) casting to lines 124, 126 as follows:

    $this->config = array_merge((array)$this->config, (array)$config);
    $default_keys = $this->configDefaults();
    $this->config = array_intersect_key((array)$this->config, (array)$default_keys);

Now I get another error message when importing from csv (one per imported node):

# Download of failed with code -1002.

The url field for each imported feed node is still blank. But now with the (array) modification, I can set those url fields manually and the feed node works OK.

Comments

DanielR’s picture

To be clear, I can work around the problem by setting each feed node's url manually but this is not practical as I have many feeds to import. I need the url feed to be set during import.

DanielR’s picture

Title: Failure to create feed nodes when importing csv » Failure while creating feed nodes from csv import
DanielR’s picture

Status: Active » Closed (fixed)

This issue is a duplicate of http://drupal.org/node/625196#comment-2794208 , and someone is looking into that.