After a lot of trial and error and research, I've managed to update CCK fields programmtically. However, I cannot update from code the value of a radio button whose options are defined as pure text (value == label):
option1
option2
instead of values and labels:
1|option1
2|option2
For the 2nd case, I can update the radio as follows:
$mynode->field_radio1[0]['value'] = 1; //works all right
node_save($mynode);
But for the 1st case, the following is not working:
$mynode->field_radio1[0]['value'] = 'Electrónico'; //loads null in content_type_mytype table
node_save($mynode);
¿Would anyone know of a solution for this?
In case it may be of any use to someone, this is the code I use for updating dates and user-references:
Update date CCK field:
$mynode->field_mydate[0]['value'] = date("Y-m-d\TH:i:s",strtotime($mail['headers']->date));
node_save($mynode);
Update user reference CCK field:
$mynode->field_myuser[0]['uid'] = $user->uid;
node_save($mynode);
Thanks in advance and regards!