Suggestion for correction:
function theme_attribute_formatter_default($element) {
+ if(!empty($element['#item']['value']))
+ {
$output = '
';
$output .= '
$output .= '
' . $element['#item']['attribute'] . '
';
$output .= '
' . $element['#item']['value'] . '
';
$output .= '
';
+ }
return $output;
Comments
Comment #1
hlopes commentedI forgot to mention the file to alter...
The file is attribute.module, the function starts at line 89.
Comment #2
mckeen_greg commentedHi HLopes,
Thank you for this! I will commit it to the next release as soon as possible.
Comment #3
finex commentedWhy not use:
Instead of:
?
Comment #4
hlopes commentedCould be... I'm just used to use empty() to check for empty values...
These are the Return Values of empty in every case:
Returns FALSE if var has a non-empty and non-zero value.
The following things are considered to be empty:
* "" (an empty string)
* 0 (0 as an integer)
* "0" (0 as a string)
* NULL
* FALSE
* array() (an empty array)
* var $var; (a variable declared, but without a value in a class)
I think it has a broader coverage of what empty means...
Comment #5
finex commentedYes... anyway, empty or not empty, the patch could be safely applied :-)