Hi,
Im creating a content(node) with 4 fields. One among the field type is computed field. In that, im displaying $node->nid. I mean $display = $node->nid. I hope $node->nid will show the nid of the node.
In my view, im showing the computed field but its coming as empty.
Im using Drupal 6. Can u pls tel wat r d changes i need to do?
Comments
Comment #1
XiaN Vizjereij commentedhttp://drupal.org/node/358306
That helped for me. Simply edit/save every affected node after changing sth. in the computed field.
Comment #2
zmove commentedHmm, I'm not sure the solution listed above are good.
I have the same problem, on the display textarea, the $node object don't seems available, even if you edit and save your node again.
Comment #3
solonim commentedI have the same problem. The $node object is available for the "computed code field" but not for the "display format field".
There is a solution to use $node object in display format without put the value in $node_field[0]['value'] in the computed code?
Comment #4
krishnaa commentedYou can try this,it will work.
Put this code in Display Format field of computed field.
$args = func_get_args();
$node_field_item['value']=$args[0]['#node']->nid;
print $display = $node_field_item['value'];
Comment #5
nicholas.alipaz commentedSure #4 works, but this is most certainly a bug. the $node object does not seem to be accessible which completely breaks the functionality needed.
Comment #6
nicholas.alipaz commentedJust to confirm this issue... It is present in beta3. If you go back to beta2 then the $node object becomes accessible again. Someone must have made a "boo boo" on the last version!
Comment #7
giorgio79 commentedThis still seems to be an issue :)
Comment #8
obrienmd commentedAgreed, this is a still an issue!
Comment #9
Pedro Lozano commentedActually the node is accesible at $element['#node'].
I've just commited a fix to make it directly available at $node. More intuitive.
Thanks everyone.
Comment #10
nicholas.alipaz commentedThanks Pedro, glad to see this finally fixed. I can finally do an upgrade :p