So there is a custom field I added called 'qid'. I can see that it is being created with each node. My issue is that I cannot programmatically save a value to my custom field. In the code below I will display and instance where I add two values, one to my custom field qid
and another to the Ubercart uc_product field height
. Height
will be saved successfully and qid
will not.
function my_module_test_page() {
$output = t('foo');
$node = node_load('151');
dpm($node);
$node->height = '555';
$node->qid = '222';
dpm($node);
node_save($node);
$test = node_load('151');
dpm($test);
return $output;
}
While I understand that this is probably not enough code to get to the root of the problem I have no idea where to look. I have scoured the node_save()
function and I dont understand why my field is having a problem. If it helps I have checked field_data_qid
in my MYSQL db; however, the table is empty.
EDIT: So the next interesting fold is that when I enter the QID field through the GUI it saves fine.
qid
field an integer or varchar in the database? If it's an integer then it makes sense because you're passing a string in as the value.$node->qid
as a string, an int, and an array with a string inside it - no luck.