I would like to have a field (
field_result) that would display a number that is the result of the product of an existing field (
field_1) on the same content type (let's call it
book) and a fixed number (let's say 3.5).
That's what I achieved so far:
- I configured field_result to accept only one value and save it on the database.
I set its value as follows:
$field_1 = field_get_items($entity_type, $entity, 'field_1'); $entity_field['value'] = $field_1['value'] * 3.5;
I set its
$display_output = $entity_field['value']
Unfortunately when I edit the node and save it I get the following notice:
Notice: Undefined index: value in eval()
and the field displays 0.00 as a result.
What am I doing wrong?