Commit 7acfc60b authored by yched's avatar yched

#111015 - fixed empty number fields displayed as '0'

parent 7bed3fd8
......@@ -183,7 +183,11 @@ function number_field_formatter_info() {
* Implementation of hook_field_formatter().
*/
function number_field_formatter($field, $item, $formatter, $node) {
// If the value is empty, we have $item['value'] = NULL
if (is_null($item['value'])) {
return '';
}
if ($allowed_values = number_allowed_values($field)) {
$item['value'] = $allowed_values[$item['value']];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment