Closed (duplicate)
Project:
Node import
Version:
5.x-1.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jun 2008 at 17:52 UTC
Updated:
28 Sep 2008 at 02:52 UTC
I have an integer cck single on/off checkbox field called hide_image. The values are 1's and 0's. The data is properly set in the CSV/TSV and maps properly on the mapping page. Unfortunately, once you are on the node preview section right before importing, all the 1 fields are set to 0. I looked at the code and it should work properly from what I can tell. I even printed $value under "case 'number_integer':" in content.inc and the 1's appear. All 1's are last thereafter.
Comments
Comment #1
Bobuido commentedI'm also having problems importing (to cck) integers
I've tried:
Using the label
Using the key
Removing the label from the definition settings and just using the key in the import
Think I'm going to give in now and just do 600+ records by hand
At least there are only two possible values and given the default is the majority of them I should only have say...100 to actually edit :)
If you can't do it the smart way - Do it the hard / long way! :)
Comment #2
robomalo commentedI did the import, then went into phpmyadmin and made a table with the right values, matched against some criteria, and did set update MySQL query. It other words, this isn't as good as the module just working properly. I looked at the code and it appears to be correct.... I couldn't figure it out.
Comment #3
joachim commentedI am having the same problem with a text field that has a set of checkboxes as a widget.
I've chased the problem down to optionwidgets.module -- all CCK fields that have radio/checkbox-type widgets are affected, I'm guessing -- updating the title of this issue accordingly.
The node_import module calls node_view.
This invokes hook_node_api on all modules.
CCK's content module calls _content_widget_invoke to invoke all widget hooks.
If the widget for a field is an option set, we get to optionwidgets.module.
The function optionwidgets_widget($op, &$node, $field, &$items) is expecting an $items like this:
but it's getting:
Here is a dirty fix that I've tested on my own case:
Above:
add:
It's not exactly graceful, as I'm clobbering the $node->$field_name without entirely understanding what it does.
But it works for me for both a radio button set and a single on/off checkbox :)
Comment #4
danielb commentedIs this a dupe of http://drupal.org/node/273423 ??
I know this was first - but the patch has been reviewed there
Comment #5
joachim commentedYes, that looks the same.
I'd seen that issue but hadn't read the patch properly...
Comment #6
m4manas commentedCorrect it is the duplicate. The easy way to import large data is
1. convert your field type to text and perform imports. After import convert it back to radio / select etc.
2. You can also apply the patch as mentioned in the http://drupal.org/node/273423 thread. If you have one time need of import then option one will do just fine.
Comment #7
danielb commentedhttp://drupal.org/node/273423