I have two content types (job_post and job_application) linked using the node reference + node reference url nodes. When I click a link in a job_post node, a new job_application node is created, so that candidates can fill out their job application. My goal is to automatically copy the content of an cck email field from the referenced job_post node to a cck email field in the job_application node.

To achieve this, I am trying to use a cck computed field, as suggested in: http://drupal.org/node/298951.

In my computed field I have placed the following code:

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

where the field_referencefieldjobapplication, is the node reference field in my job_application node.

In the display format box of the computed field I have:

$display = $node_field_item['value'];

I have selected the option to store it in the database as a varchar.

However, nothing seems to happen. I never see the cck field or its content both when I create or after I save a new job application (I have even tried to see it in views and failed). Any suggestion on what might be wrong?

Thanks

Comments

talatnat’s picture

I followed the same instructions you did and also came up with an empty field. If you figured it out, please let me know. I'm using Drupal 6.20, and CF 6.x-1.0-beta4. Thanks.