Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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"???
Thanks.
Comments
Comment #1
tm541 CreditAttribution: tm541 commentedFollowing, I am getting the same error.
Comment #2
xqbzzr CreditAttribution: xqbzzr commentedSame 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.
Comment #3
dqdDue to the Drupal core life cycle policy and security support advisery, Drupal 6 is no longer supported. So issues for Drupal 6 cannot be longer maintained. The project maintainer has asked for closing all D6 issues to clean up the issue queue. Feel free to reopen the issue if required or set it to "needs to be ported" and latest D8 dev version, if the issue discusses a still missing feature which can be implemented in the D8 version.
Comment #4
dqd