The taxonomy mapper doesn't check for repeat terms before adding them to the node. The node field must allow unlimited cardinality to see this minor bug. The result can be the same term appearing multiple times on the node.

Adding array_unique before parsing out the terms fixed the problem for me.

Patch attached, sorry for the p4 format.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, taxonomy-unique-1.patch, failed testing.

nadavoid’s picture

Title: Duplicate taxonomy terms freely added to node » Duplicate values on multivalue fields when updating
FileSize
1.99 KB

This happens on text fields too, and possibly others. Attaching a patch that addresses this for both termreference and text fields.

nadavoid’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: feeds-duplicate_taxonomy-2172865-2.patch, failed testing.

twistor’s picture

Version: 7.x-2.0-alpha8 » 7.x-2.x-dev
Category: Task » Bug report
Status: Needs work » Closed (works as designed)

This is per-design. If it's in the feed, it's in the field. There could be an argument for doing this for term reference fields, but definitely not text fields. You can use something like Feeds Tamper to filter the list before it gets into the mapper.

nadavoid’s picture

Status: Closed (works as designed) » Needs review

@twistor, could you reconsider this? The issue is not that multiple duplicate values that are present in the source feed get imported. Let me describe the issue a little better...

Say you have a content type with a title, a unique ID field (for updates) and a multi value text field called Cities. Have a csv file with title in one column and cities in another column, pipe delimited. Using feeds tamper, you split out those cities. When you import the first time, everything looks right. You have one of each value that was in the source csv. You have the importer set to update content when reimporting. So I update the title in the csv and reimport. The title is updated, but now I have two of each city that is in my source feed, even though I didn't change or add any. If you update the title 5 times this way, you'll have 5 duplicates of every city. That's what the attached patch addresses.

twistor’s picture

Can you try the recent dev release? This should already be fixed.

nadavoid’s picture

Status: Needs review » Fixed

@twistor I just just tested the latest dev release and this issue does seem to be fixed there. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.