Closed (fixed)
Project:
Computed Field
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
22 Nov 2011 at 22:10 UTC
Updated:
14 Feb 2012 at 20:03 UTC
First of all thanks for this awesome module.
I just had this question: How can i prevent the rendering of the computed field if the calculation results 0/null/error as a cause of another field being left blank. Since the computed field i created needs the value of another float field, if the other one doesn't get a value, then my computed field renders with the output of 0.
I would like it to not render at all.
Is it possible to achieve this?
Best regards
Elvin Xhimitiku
Comments
Comment #1
colanYou would need to (1) set your field as a string in the configuration, and then (2) return the empty string in order to achieve this behaviour. The module is designed this way because folks would generally want to show the number "0" as a result if it's calculated from something.
Comment #2
colanComment #4
colanOr at least it should work that way. Too many strings are being considered empty. See #1440234: Zeroes in string types are assumed to be empty (DB used for storage) for details.