I have used feeds to import some nodes with taxonomy term reference.
The source XML is the following one.
<items>
<item>
<title>Test 1</title>
<body>Test body 1</body>
<term>My_term_foo</term>
</item>
</items>
First import is OK. I edited <term>My_term_bar</term>
, and started importing a second feed.
After the second time, the node has both "My_term_foo" and "My_term_bar," but I need only "My_term_bar" from the second import.
Is there any hook_feeds_node_item_presave()
I can use to alter the values being imported?
EDIT:
My final code of hook_nodeapi inpired by sel_space:
switch ($op) {
case 'presave':
if ($old_node = node_load($node->nid)) {
$taxonomy = array_diff_assoc((array) $node->taxonomy, (array) $old_node->taxonomy);
if (!empty($taxonomy)) {
$node->taxonomy = $taxonomy;
}
}
break;
}