When importing nodes (into a CCK type) the new taxonomy terms are being created in the vocabulary, but they're not getting associated with a node.

Well, nearly all aren't - except the first term in the CSV.

Might be related to http://drupal.org/node/53044 - but I got a bit confused as to what the bug was there. Plus i'm using CVS from today and still have the issue.

Comments

jon pugh’s picture

I am having the same problem, but even terms that already exist are not getting associated. Using latest CVS... never used this module before so I can't help with the code.

Kimeros’s picture

I had the same problem.

I'm still not really sure what's happening but when I placed line :

$taxonomy[$vocab->vid] = array();

Outside the if statement as well as inside it, The taxonomy is linked to the node as well as the term being created. (around line 93)

      //we can now be "sure" that the term is created if needed, so
      //now create $node->taxonomy
      if (!empty($terms) && !isset($taxonomy[$vocab->vid])) {
        $taxonomy[$vocab->vid] = array();
      }

      // Following line added.
      $taxonomy[$vocab->vid] = array();

sym’s picture

Priority: Normal » Critical

This is still active, and It's a big problem for people wanting to add 100s of nodes.

Has anyone made any progress on this?

sym’s picture

Ok, I've done more testing now.

testing on:
* clean 4.7
* using both the category module with the wrapper and the core taxonomy module.
* CCK nodes
* Page nodes

The problem is with every term of every node type.

I went the module adding prints before and after all the main functions and loops. When $node is returned to node_save the correct terms are in place.

Is this module active at all, and is anyone who might know what to do readint this? This issue is old and I can't see any attempt to fix it. I need this to be fixed before I can import about 3000 nodes in to site i'm making, and there is no way I'm adding the terms by hand! I have tried to fixed the problem, but I don't know enough about the node api to debug it!

Help!

bdragon’s picture

I see this too, and I'm going to see if I can figure it out.

--Brandon

sym’s picture

Great - if you want to contact me to talk about it then feel free :)

webchick’s picture

Subscribing. Possibly helping, we'll see. ;)

Robrecht Jacques’s picture

Status: Active » Fixed

I believe this is fixed in CVS.

Please check!

If it doesn't work as expected, please reopen this issue (Status => active) and add a new comment with a sample CSV file that fails and some information about the configuration of the vocabularies you defined.

plumbley’s picture

Status: Fixed » Active

Its possible the problem may be in supported/taxonomy.inc (taxonomy.inc,v 1.2 2006/09/15 20:05:26 robrechtj). Lines 18-19 are

function taxonomy_node_import_prepare(&$node, $preview = FALSE) {
  $vocabs = taxonomy_get_vocabularies($type);

which gives a Notice:

Notice: Undefined variable: type in .../modules/node_import/supported/taxonomy.inc on line 19

This looks like a bug - perhaps this should be the following instead?

  ...
  $vocabs = taxonomy_get_vocabularies($node->type);

(Sorry not set up to make patch for this at the moment). Mark.

Robrecht Jacques’s picture

Status: Active » Fixed

Correct. $type should be $node->type.

Fixed in CVS.

Anonymous’s picture

Status: Fixed » Closed (fixed)