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!
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | replace-taxonomy-963534.patch | 2.18 KB | guillaumev |
Comments
Comment #1
alex_b commentedYou 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.
Comment #2
guillaumev commentedHi,
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.
Comment #3
ben.hamelinAlex- 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?
Comment #4
molave commentedSubscribing. 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! =)
Comment #5
agittins commentedI 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?
Comment #6
damatmadeforcom commentedsubscribing
Comment #7
megachrizThis 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.