I've setup a computed field that calculates an average from two fields. Now when I leaves those fields empty of put '0' in them, I got this warning message:
"warning: Division by zero in /home/afcain5/public_html/sites/all/modules/computed_field/computed_field.module(161) : eval()'d code on line 1"
even though it did saves it but how can I set it up where it won't evaluates when the values are "NULL" or "0"???



tm541’s picture

Following, I am getting the same error.

xqbzzr’s picture

Same here. I am doing some calculations across different fields. I can add a discount percentage that multiplies the value. When i leave the discount field empty I get a similar error:
Notice: Undefined offset: 0 in eval() (Zeile 1 von /www/htdocs/xyz/D7/sites/all/modules/computed_field/computed_field.module(466) : eval()'d code).
I do not get the error when entering 0 into the discount. But that always renders the field as "Discount: 0".
But the rest of the calculation works fine.