Right now you must have your vocabulary set to free-tag to have the taxonomy mapper to save new terms. I think this is a limitation because you can arrange terms in an hierarchy when using vocabularies of the free-tag type. So to solve this, the taxonomy mapper needs to be able to save new terms for non-free-tag vocabularies too! I think this is the behavior one expects from an import process like this.

The attached patch fixes this.

Comments

Monkey Master’s picture

The problem: First item with new term has no terms at all after import. Solved by removing this:
$new_term['tid'] = db_last_insert_id('term_data', 'tid');
taxonomy_save_term() already fills $new_term['tid'] with correct value. then db_last_insert_id() overwrites it with something strange in my case...

alex_b’s picture

Status: Needs review » Needs work

dixon_ : you're right, import suggests that new items are being created if they're not present. If this collides with another use case we should add an option in the UI *if* someone complains, so your approach is fine.

#1 needs to be addressed.

alex_b’s picture

Version: 6.x-1.0-alpha11 » 6.x-1.x-dev
Status: Needs work » Needs review
StatusFileSize
new1.92 KB

This patch applies fix described in #1. dixon_ could you give me a review?

janusman’s picture

Is there some chance that this could be an option in the UI instead of hardcoding it one way or the other?

In my use case I actually prefer not to add terms to non-tag vocs (which is, BTW, the way Drupal behaves out of the box... if anything, that could be a design rule to follow: "when in doubt, follow core").

alex_b’s picture

#4 Point taken. We could make this an option on the taxonomy form. Options on the mapping form will require some serious extension to the mapping UI. A shortcut could be to add a checkbox to the taxonomy vocabulary edit form. Not ideal.

alex_b’s picture

Status: Needs review » Needs work

Re #4: NW

guillaumev’s picture

Status: Needs work » Needs review
StatusFileSize
new5.28 KB

Hi,

I created a patch which adds the option at the processor options form level (see FeedsNodeProcessor). It's still not as ideal as an option that would appear at the mapping level, but it will probably fit janusman and dixon's use cases.

Note that this issue can be seen along with issue 963534 (http://drupal.org/node/963534)

twistor’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)