Can't get the function to work.

computed_field_field_myfield_compute ($node, $field, $node_field) {

	$node_field[0]['value'] = "test";
}

This function works, but the node object is not available.

computed_field_field_myfield_display($field, $element) {

	$display = "test";
return $display;
}

not storing data in database.
display function stops working when compute function is added.

Comments

driki_’s picture

same here

timhsieh’s picture

I think that computed_field_field_myfield_compute should pass the $node_field parameter by reference rather than by value, otherwise you are making changes to a copy rather than the real thing. In other words, your declaration should look like this: function computed_field_field_myfield_compute($node, $field, &$node_field){YOUR_STUFF_HERE} (that is, with an ampersand in front of $node_field)

mmjvb’s picture

Issue summary: View changes
Status: Active » Closed (outdated)