This is specific to the Node Processor, updating existing nodes, with a mapping of multiple columns to a single taxonomy vocabulary. I'd like the option to force a "strict" taxonomy mapping for a given feed. Meaning, all taxonomy assignments for a given vocabulary would be removed before processing the feed. This would be helpful in scenarios where you want to match the feed exactly. I have my importer set to "update existing nodes," which it does fine on all the other basic text fields, but with taxonomy, I'm finding that I need to add code to handle the removal of taxonomy terms that no longer apply. Is this possible already, and am I simply overlooking something, or is this truly a feature request?
Thanks all!

CommentFileSizeAuthor
#2 replace-taxonomy-963534.patch2.18 KBguillaumev

Comments

alex_b’s picture

Title: Node processor taxonomy mapping configuration - assiging all terms in from feed, removing any others for that vocabulary » Update / replace existing does not remove existing taxonomy terms
Version: 6.x-1.0-beta4 » 7.x-2.x-dev
Category: feature » bug

You found what I would actually call a bug. The reasons for this behavior run deep though. E. g. there is no 'event' a mapper can hook into in order to 'clean up' a node before new content is mapped to it. This issue concerns the drupal 7 and the drupal 6 branch.

If you'd like to see through a patch let's get in touch over IRC and discuss this issue.

guillaumev’s picture

StatusFileSize
new2.18 KB

Hi,

In case it helps someone, I needed the same functionality, so I created a patch, which I'm attaching. Please note that the patch is based on v6.

ben.hamelin’s picture

Alex- just stumbled across this as we're working on one of our first 7 installs for an internal project and am mapping some existing blog posts (from a 6 site via RSS) to our new install. I'll get an update to this in here shortly, have you reviewed the patch submitted previously?

molave’s picture

Subscribing. Have this issue too on D7. I can't seem to be able to update existing taxonomy terms. I just end up adding duplicates of the same terms with only the custom taxonomy fields updated. Odd, because I used the mandatory GUID mapping to specify what node it is I want to replace, and I also checked the "replace existing nodes" radio button. Thanks! =)

agittins’s picture

I found guillaumev's patch in #2 worked for me also (D6 here as well). One chunk of the patch failed to apply (the admin ui checkbox) but it was trivial to fix.

This seems to be a good and elegant solution - not everyone will want to override the taxonomy on import so making it an option is an excellent call. The only way I can think of that might be better is to add the feature as a tamper plugin - that way it could do the same for cck fields etc - I don't know if it's possible (or warranted). Anyway, the patch as presented worked well for me.

Should this be raised as a separate d6 issue so the patch can be committed to that branch?

damatmadeforcom’s picture

subscribing

megachriz’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)

This should be fixed as part of #1107522: Framework for expected behavior when importing empty/blank values + text field fix. Field targets are now emptied first before new values are written to it.