The $field_empty template variable is set to false when the field is empty and a prefix or suffix is set in the field definition.

Comments

yched’s picture

True, the number formatter doesn't account for the case where the incoming value is array('value' => NULL).

Can be easily fixed, but raises a more general question : do we want those empty values to be present in $node to begin with ?
We currently get $node->field_foo = array('value' = NULL);

We could chose to simply not load them (I think jpetso had that request, for instance) - could be either :
- no $node->field_foo entry if the field is empty.
- $node->field_foo = array(); if the field is empty.

yched’s picture

Status: Active » Fixed

After a bit of thinking, some formatters might want to display something special when a field is empty - so we need to load empty values anyway.

So I simply fixed the prefix / suffix bug for empty number fields.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.