I am trying to accomplish something like this, but it does not work:

$entity_field[0]['value'] = array_pop(array_pop(field_get_items('comment', $entity, 'field_cost')));

The computed field is on the content node but the information is for the computation is on the comment.

Comment 1 field_important_info

Comment 2 field_important_info

In a case where the field is on the content node, it is quite easy: $entity_field[0]['value'] = $entity->field_important_info[LANGUAGE_NONE][0]['value'];

Is the only way to do this through query or is there an easier way? Any hints on 1 value or multiple values from comments are appreciated.

Thanks.

/GrN.dk

Comments

woofer121’s picture

Issue summary: View changes

Hi, I have the same problem, I'm trying to use node's comment fields.
Grn, have you found a solution?

thanks

grn’s picture

Hi. No sorry. I can't remember what I needed it for.. :-/

/GrN.dk