Closed (fixed)
Project:
Feeds
Version:
7.x-2.0-alpha3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Mar 2011 at 18:08 UTC
Updated:
7 Dec 2011 at 20:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
wilkenw commentedWill check the latest dev iteration for this problem.
Comment #2
todddevice commentedsubscribing
Comment #3
todddevice commentedtype list_text is absent from the array of eligible string type fields in field.inc. The attached patch may help.
Comment #4
retolist commentedSubscribe
Comment #5
Countzero commentedMany thanks todddevice for the patch. Did the modification manually, but it definitely works. Great !
Comment #6
parvardeh commentedCould someone please tell me how to apply or install this patch. I want the same functionality that the patch offers but I dont have any idea how to add this patch to Feeds module.
By the way I am using Drupal 7 on windows.
Comment #7
l_o_l commentedFor manual applying the patch:
Open the patch as a text file. Study it. In you will find a file reference. That is the file the patch is meant for. Browse through the module map to find exact that file. In the patch text are one or more lines with a '-' and/or '+'-char at the very beginning. These lines have to be deleted and/or added to the source of the file.
Good luck !
Comment #8
Seraphin42 commentedsubscribing
Comment #9
Countzero commentedYou can also use the instructions on this page : http://drupal.org/patch, which is the proper way of using patches.
Comment #10
emorency commentedI modified the function field_feeds_set_target_text to allow to import multiple values since it's a list... The delimiter is '|'.
I tried using Field Tamper but I was not able to enable the tampering...
/**
* Callback for mapping text fields.
*/
function field_feeds_set_target_text($source, $entity, $target, $value) {
if (!is_array($value)) {
$info = field_info_field($target);
if ($info['type'] == 'list_text'){
$value = explode('|', $value);
}
else{
$value = array($value);
}
}
_field_feeds_set_target($source, $entity, $target, $value, TRUE);
}
Comment #11
emorency commentedHere is a patch to allow to import multiple values when the type if the field is a "list_text".
Comment #12
parvardeh commentedThanks.
Comment #13
upupax commentedI can't get this to work.
I applied both patches successfully, but I still can't import values in my text_list/radio button field.
I've tried to switch to list widget but still have no effect.
Comment #14
emorency commentedThe delimiter must be ','
The fix works with something like this:
"field_1";"field_2"
"text";"value1","value2"
I use the ; delimiter because Excel does not really like to open csv with , delimiters. Also, to avoid any problems I use double-quotes to allow to have some text values that contains comma.
To import items for lists, be sure to have the key, not the value. For example, if you defined your list like:
1|First item of my list
2|Second item of my list
...
You should import "1".
Hope that helps!
Comment #15
upupax commented@emorency unfortunately I'm working with XML files, so I don't have to take care about delimiters.
Comment #16
pcambrapatch in #3 seems to be already included
Comment #17
pcambraI don't think that patch in #11 makes sense to be included into the "core" feeds module as it forces the delimiter to be a comma and probably is not suitable for every case.
I'd suggest to use feeds_tamper or maybe custom code with hook_feeds_after_parse to split the multivalues
Comment #18
Pocketpain commentedsub
Comment #19
imiksuConfirming that #3 patch is working for me (used xpath parser with single-value field).
Comment #20
vin247 commentedAnyone know how to get this working on version 6?
Comment #21
rfayWell, there are two patches here, one possibly committed? Setting to "Needs Review"
Comment #22
jedprentice commented#3 has apparently been committed, and seems to work. I was able to map a list text field and import successfully using the attached CSV. The field mapper unit test could/should be updated, though.