Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I've imported a csv to a content type and it has imported all the nodes perfectly and all the fields show up correctly on the page.
However, when I go to edit a node, one field (a select list of radio buttons) is blank - even though the selections appear on the page. So everything works fine until I go to edit the page and, unless I manually check the radio buttons, the selections are lost on save.
I'm certain that the 'Allowed vaules' list are identical in both the content type and the csv, in the format selection1 |selection1 etc
Can you help.
Brilliant module by the way - it's like magic!
Comments
Comment #1
1mundus CreditAttribution: 1mundus commentedThe same problem here.
Comment #2
1mundus CreditAttribution: 1mundus commentedStrange, I have checked my "old" nodes - imported with alpha5. All of them have select lists selected. It seems that this problem appeared with this version.
Comment #3
Rob_Feature CreditAttribution: Rob_Feature commentedYup, seeing the same thing here in that latest dev. Additionally, editing the node and resaving it causes all the select list content to be reset to NULL.
Comment #4
Rob_Feature CreditAttribution: Rob_Feature commentedupping to major since this is gonna cause some havoc on feeds with select lists.
Comment #5
LiorFil CreditAttribution: LiorFil commentedHappened here as well.
I have the 7.x-2.0-alpha7 version installed.
Any solutions yet?
Comment #6
Rob_Feature CreditAttribution: Rob_Feature commentedI found that this may be partially a documentation issue. Some places indicate you should import the key for the select item, other places say the value. I ended up importing the key and this started working for me.
Comment #7
1mundus CreditAttribution: 1mundus commentedMy key and value are the same, so it's not that in alpha-5. Can't tell for later versions, I'm using alpha-5, because image alt and title patch isn't working for the later ones.
Comment #8
Exploratus CreditAttribution: Exploratus commentedSame problem.
Comment #9
mwallace001 CreditAttribution: mwallace001 commentedSame problem here... subscribing
Comment #10
immoreel CreditAttribution: immoreel commentedIt's because an extra space gets added with the value, adding trim with feeds tamper seems to fix this for now...
Comment #11
twistor CreditAttribution: twistor commented@immoreel, I don't think that's the issue that other people are having.
Can someone give me a detailed example of how this is happening?
Comment #12
cecrs CreditAttribution: cecrs commentedI'm having the same issue. Here is my configuration:
Feeds 7.x-2.0-alpha7
Feeds XLS 7.x-0.0
Feeds Tamper 7.x-1.0-beta5
I am importing data from an .xls file. I have a field, field_example, that is a list(text) field, displayed as a select list. When importing a value that is in the Allowed Values list in the field configuration, the data displays correctly on the front end, and is selected in field_example on the node edit form. If the imported value is *not* in the Allowed Values list, the data displays as expected on the front end, however, on the node edit form, nothing is selected for field_example on the node edit form, and when the node is saved, the data disappears from the front end as well. Adding a 'trim' filter with Feeds Tamper had no effect on this behavior. If the key matches the imported data, it is imported properly, and selected in the back end. If the label matched the imported data, but not the key, the data is displayed on the front end, but is not selected on the back end, and disappears on node save.
Please let me know if I can provide any further information.
UPDATE: I updated to the latest Alpha8 version of Feeds, same problem, same behavior, fwiw.
Comment #13
bearstar CreditAttribution: bearstar commentedUsing Feeds Tamper Explode plugin on my multi select lists solved the issue for me.
Comment #14
hockey2112 CreditAttribution: hockey2112 commentedI am experiencing the same issue. Some of my fields are selected correctly in the edit screen of my nodes, and others are not selected correctly. How can this be fixed? Is there any way to fix it once the nodes have been imported? I have 8,000+ nodes, so it would be pretty inconvenient to have to re-import them all.
---EDIT---
It appears that my issue was related to the fact that some of my keys had spaces or slashes in them. (ex: "Red Hat" or "Blue/Green"). I used Feeds tamper to find/replace the spaces and slashes with "nothing", changes the keys for my options on my node type, and re-imported the nodes successfully.
Comment #15
silurius CreditAttribution: silurius commentedWith select list text fields, Feeds cares about the key of that CCK field and not the value. In a nutshell, you either have to match the key exactly in your spreadsheet and CSV prior to import, or you do what you did with a Feeds Tamper find and replace. It's likely that your key/value pairs appeared to be identical but were really not due to those special characters.
I know you fixed the issue, but I thought I'd add a few details just in case you encounter other aspects of the same problem. For instance, this would also happen if you decided to use custom keys.
Comment #16
tinem CreditAttribution: tinem commented#15 I do as explained here and manually change in my CSV-file prior to import but would also try to do what #14 explain and use Feed Tamper to find and replace but can't figure out to get this working and hope some one could help showing me a PrintScreen how it should be done or explain step-by-step, please?
Have several allowed value list like:
So what should I do in Find/Replace to get this working for all these lists, please?
Comment #17
silurius CreditAttribution: silurius commentedWhat issues are you having, tinem? The basic steps would be:
1. Go to the tamper tab for your feed (admin/structure/feeds/your_feed_name/tamper).
2. Click "Add plugin" for the field you want to add find/replace.
3. Choose "Find replace" from the first select list (it's in the "Text" section).
4. Enter "Ja" into the "Text to find" field.
5. Enter "1" into the "Text to replace" field.
6. Repeat steps 2-5 for each field.
Comment #18
tinem CreditAttribution: tinem commentedFor my site Feeds 6.x-1.0-beta13 and Feeds Tamper 6.x-1.0-beta4
Thanks silurius for trying to help. My issue is I have to change my CSV-file manually to work:
where people have used "Ja" to "1"
where people have used "Nej" to "0"
where people have used "Ved ikke" to "2"
This is how it looks inside Drupal 6 http://tinemuller.dk/div/bemanding.jpg
I have already tried what you suggest and first replace is functioning but I need to do this 3 times for the SAME field and if I try second time making a new plugin with replace on the same field I get an error "id is taken".
Some have suggested using explode plugin but I can't figure out to do it RIGHT because I can't code in PHP. :-(
Comment #19
silurius CreditAttribution: silurius commentedThat's right, you will need to create three "Find replace" plugins, one for each of those three keys:
1. Find "Ja" and replace with "1"
2. Find "Nej" and replace with "0"
3. Find "Ved ikke" and replace with "2"
For the third one, you may need to check the "respect word boundaries" box that should be below the replace field). Or if that doesn't work, you could create two "Find replace" plugins for that field:
1. Find "Ved " (note the space) and replace with "2"
2. Find "ikke" (no space) and replace with nothing
I'm on Drupal 7, and I'm assuming multiple plugins can also exist in Drupal 6.
The Explode plugin is only necessary for imported nodes that contain multiple values (e.g., both "Ja" and "Nej" exist for a given node). If each node only has a single value for that field, no Explode plugins are necessary.
If all of this is too confusing or too much trouble, or just doesn't work, you might also consider changing your keys to match your values (e.g. Ja|Ja). To do this, you would add the new key/value pairs and update existing nodes on your site using Views Bulk Operations to use the new key/values, and then delete the original keys/values (e.g. 1|Ja).
Comment #20
tinem CreditAttribution: tinem commentedSo happy that you take the time to help me but not possible to have multiple plugins as you suggest on Drupal 6.
Ja is OK - http://tinemuller.dk/div/ja_ok.jpg
Nej not OK - http://tinemuller.dk/div/nej_id_is_taken.jpg
Ved ikke not OK - http://tinemuller.dk/div/ved_ikke_id_is_taken.jpg
AND I need to do the same for ALL these fields with select list - http://tinemuller.dk/div/tamper_select_list.jpg
And there also is a problem with clone - https://drupal.org/node/2258377
A solution could be to update the code as mentioned here - https://drupal.org/node/2006810#comment-8739475
I have made a 3 minutes video showing what I need it for - http://tinemuller.dk/findtoilet/VIDEO/feeds/ :-)
Comment #21
silurius CreditAttribution: silurius commentedThe screenshots indicating that "Nej" and "Ved ikke" are not OK show that you need to define unique machine names for those plugins. When I create multiple plugins for a given field I usually just add a number to the end of the machine names, to make them unique. So "Nej" would have a machine name of "find_replace2" and "Ved ikke" would have a machine name of "find_replace3".
I've never cloned an importer before, so I'm not sure about that one. Sounds to me like the cloning process simply doesn't copy over the corresponding tamper.
Comment #22
tinem CreditAttribution: tinem commentedSadly it doesn't functioning. Think I have to update my site to Drupal 7 and use all the patches both for Feeds and Feeds Tamper to solve my problems. But thank you very much for trying to help.