No matter what value I place in $node_field[0]['value'] the result is always 0 (zero).
Initially i did this: $node_field[0]['value'] = $node->field_position_pta[0]['nid']; field_position_pta is a node reference.
I then did this: $display = $node_field_item['value'].
Thinking i may have coded incorrectly i tried the following:
$node_field[0]['value'] = '25';
$node_field[0]['value'] = "25";
$node_field[0]['value'] = 25;
each and every time the result was still 0 (zero).
I then tried: $display = $node_field[0]['value']. But ended up with no value displayed at all.
I set data type to int and data length to 4.
I cleared the cache each time i changed the code.
Comments
Comment #1
Moonshine commentedNot sure about this one but moving it to support request. Should probably try a newer release like beta3 or the new dev. Can also put some code in your field to help debugging like this at the end:
Comment #2
fatcheeks commentedHi. I'm having the same issue as TomSherlock. I'm setting $node_field[0]['value'] to the node id and even changed the default value to something else other than 0, but those didn't have any effect.
Tried the debugging suggestion in #1 as well. Drupal just displays "value: " ($node_field[0]['value'] is blank).
How can I fix this? Any help is appreciated. Thanks
Comment #3
giorgoskI have had the same problem just now
and I had to check "Store using the database settings below (required for Views use)" in the settings
admin/content/node-type/CONTENTTYPENAME/fields/field_FIELDNAME
and republish all the content that was using it
in admin/content
does that help ?
Comment #4
fatcheeks commentedI solved this by unchecking that option so that the value would be calculated on the fly during node load. It finally hit me when I read the handbook explanation on http://drupal.org/node/126522. Just in case anyone is facing the same problem, I'm quoting it here.
Comment #5
problue solutionsIm having this issue with "Store using the database settings below (required for Views use)" both checked and unchecked, nodes are updated, still displays nothing.
$node_field[0]['value'] = 'Testing';
$display = $node_field[0]['value'];
Nothing is displayed.
Comment #6
giorgoskincrease data length (available space to store value)