Hi,

I have a lot of computed field and cck field in my content type.
Some computed fields take the value of others nodes thanks to node reference and this code :

$node_field[0]['value'] = db_result(db_query("SELECT field_longueur_panneau_value FROM content_type_panneau WHERE nid=%d",$node->field_modelepanneau[0][nid]));

And the others computed fields use the value of others computed fields like that :

$node_field[0]['value'] = $node->field_puissance_panneau_client[0]['value'] * $node->field_nombrepanneaux_client[0]['value'];

When I create a content some fields are not calculate correctly. I need to edit and submit again my content to have all my field correctly calculate.
I think this problem comes from the order of calculation of fields but I'm not sure.
What is this order? Not the order of the fields in the content type, maybe their order of creation?

There is a solution to have all my fields correctly calculate at the node creation?
In all my computed field I can replace "$node->field_puissance_panneau_client[0]['value']" by the code there is in the field "puissance_panneau_client" but I would like avoid that... some comp fields use comp fields that use comp fields... and I need to display for each intermediate value a field with the value.

Thanks for your help and sorry for my english!

Comments

solonim’s picture

Ok, it was a bug in my content type because of I had fieldset (group) with the same db name in different content type...
Computed field are well calculate in the order that they are display in the page.

mmjvb’s picture

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