Closed (outdated)
Project:
Feeds
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Nov 2010 at 07:57 UTC
Updated:
9 Feb 2026 at 19:17 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
twistor commentedThis patch tries to change as little of the logic as possible. I think it might be better to check the type in field_feeds_set_target_text and not in _field_feeds_set_target at all. It comes down to whether we should try to enforce type or let the field implementations handle it.
If we go this route, most (guessing) of the target mappers will have to change and we should be careful as these will be references for anyone else implementing them. Most of them are copy-paste jobs as it is. It should also be documented that this is the required behavior.
Comment #2
twistor commentedComment #3
nicolash commentedsubscribe
Comment #4
hansrossel commentedThis is how it was done for the 6.x version: #873198: Import multiple values to tag vocabulary
Comment #5
ericmaster commentedsubscribe
Comment #6
maureen commentedI'm not a programmer, and I still don't know how to create a patch after all this time. But here is how I solved this problem when I ran up against it today. Since I was using a semicolon as my field deliminator, I could use a comma to separate the multiple values. I know it's not a final solution, but thought it might help someone.
I changed the follow function in the mappers/field.inc.
Comment #7
puhig commentedHi , Exist a equivalent on drupal 6.x for field_info_field($target) ?
Thanks
Comment #8
juampynr commentedhook_feeds_after_parse() may be of help here. Please read http://drupal.org/node/1360518.
Comment #9
colanMarking #1231522: Having multiple values in a CSV imported into one target value. as a duplicate of this issue.
Comment #10
chrisroditis commentedTested patch in #1 and works great for mapping multiple sources to the same target field (tested with a multivalue text field)
Comment #11
danon1981 commentedI Was looking for a solution for this as well and found that using Feeds tamper you can accomplish this through the following procedure.
Because the last field overwrites all previous submissions when mapping multiple fields to one field (in my case a free tagging multiple value taxonomy field)
Step 1 Use the "rewrite" filter on de last mapper that submits to the field you map to your target field. Select al the required fields that you like to include using the replacement patterns and separate them by a comma,
Step 2 Add a "Explode" filter, and leave the comma as "String separator"
Make sure these filters are in this order ( 1.rewrite 2.explode) that's it you can now map multiple value sources to one target field.
Comment #12
gravit commentedThere is one additional caveat here -
It seems feeds tamper goes in alphabetical order for some things - If you are using Feeds Tamper to do any sort of field alteration (find and replace, convert to boolean, etc) You need to make sure the "last mapper" is also the last field alphabetically. Otherwise your field alterations will not happen before the "rewrite" filter on the "last mapper".
Comment #13
anibal commentedFeeds tamper does it in perfection. its kind of weird, the logic i mean, but in the end it will do the job.
Great module.
Thanks for the tip.
Comment #14
matt b#11 - great tip - thank you!
Comment #15
hanskuiters commented#11 is a nice tip. Tested on a free tagging multiple value taxonomy field.
One thing though: the first field is inserted without the explode. So if I have a first field with (term1,term2) and a second field with (term3,term4) the inserted terms will be:
- term1,term2
- term1
- term2
- term3
- term4
If I set an explode tamper on the first field, and use that in the second field, the inserted terms will be:
- array
- term1
- term2
- term3
- term4
Comment #16
hanskuiters commentedhook_feeds_after_parse() from #8 helped me here. Thanks.
Comment #17
naeluh commentedHas this functionality been committed to the module d7 version or does it require the patch ?
does patch in #1 work for d7 dev
Because i cannot get this to work
I am trying to import a csv
I have a 5 radio button field that I am trying to populate
- update 02/12/13
I got it to work by just using explode and no rewrite plugin
Comment #18
Balbo commented#11 made my day!
Comment #19
llillf commentedI just figured out how to map multi-files (multiple columns in CSV file) to the same target. Hope it helps anyone.
D7 mappers/file.inc
Comment #20
xpersonas commented#11 is great. My problem though is that i have a few nodes that have multiple images. The rest just have one. So when I run the import, I get failed node imports because the second image field is empty....
Comment #21
osopolarThis patch will make it possible when there are values from different mappings to the same target they will be added as multiple value. It would be also possible to keep alt and title attributes in sync with the file. Last but not least it will use the cardinality more efficient when some files could not be added or if there are empty source fields.
Comment #24
osopolarFor SipleTest exceptions, see: #2150989: SimpleTest fails: Undefined index: content-type, Notice file: http_request.inc Line: 57
Comment #25
rcodinaJust added related issue for Drupal 6 version of this module. Could anyone make a patch which passes the tests? I really need this feature.
Thank you!
Comment #26
osopolarDue to #2093651: Simplify target callbacks. the patch won't apply anymore to current d7 dev version.
Comment #27
twistor commented#2093651: Simplify target callbacks. Should have actually fixed this for everything it could in 7.x-2.x.
@rcodina, Do you have a specific field that's not behaving correctly? That would be much faster to patch, especially for 6.x.
@everyone, This can't really be fixed generically at this point. It's fixed in 8.x-3.x, which I realize helps no one, but a general fix is too API intensive at at this point.
Comment #28
rcodina@twistor, I just need to map multiple fields to same target on D7 (I'm doing a migration from a D6.)
Comment #29
twistor commented@rcodina, It just depends on the field. Fields with multiple columns, for instance the Link field, won't work at this point, but all basic fields should work.
Comment #30
rcodina@twistor, In my case I have two different file fields on D6 that I want to map to same field on D7 (a field which can have unlimited values). So as you said I have to wait (my current workaround is having two fields on D7). I'm using dev branch from February 11, 2014.
Comment #31
eric_a commentedWhat is needed for this issue to get closed? Why is it that mappers would not be able to just leave alone already set field items?
Comment #32
twistor commentedIt's fixed in 8.x-3.x, a backport will happen at some point.
Take the link field as an example. It has a title and url column.
The way that targets currently work, is that they receive title => a, b, c and url => 1, 2, 3 in separate calls, so there's no way to determine if a field value for title was set before, or is empty, when setting the url values.
Comment #33
eric_a commented@twistor, thanks for the example!
My use case is mapping different XML elements (one for image, one for video) to the same item type. So as long as a target item isn't split up into multiple sub-targets, mappers should account for this, I guess.
Comment #34
summit commentedHi, @Twistor, thanks for updating! When will it be backported to 7.dev?
Greetings, Martijn
Comment #35
bulldozer2003Wish this was backported already. I found a solution using Feeds Tamper to address the problem in #15 when using the fix in #11.
I was trying to import two LDAP sources into one target field.
I was ending up with
What I did was install Feeds Tamper and
Comment #36
bluegeek9 commentedDrupal 7 reached end of life and the D7 version of Feeds is no longer being developed. To keep the issue queue focused on supported versions, we’re closing older D7 issues.
If you still have questions about using Feeds on Drupal 7, feel free to ask. While we won’t fix D7 bugs anymore, we’re happy to offer guidance to help you move forward. You can do so by opening (or reopening) a D7 issue, or by reaching out in the #feeds channel on Drupal Slack.
If this issue is still relevant for Drupal 10+, please open a follow-up issue or merge request with proposed changes. Contributions are always welcome!
Comment #37
bluegeek9 commented