When you display the actual boolean values as label using the "boolean_formatter_display_value_with_format" method the displayed
value is always the opposite what you expect it to be.
The available formats look like that:
$formats = array(
'yes-no' => array(t('Yes'), t('No')),
'true-false' => array(t('True'), t('False')),
'on-off' => array(t('On'), t('Off')),
'enabled-disabled' => array(t('Enabled'), t('Disabled')),
'boolean' => array(1, 0),
'unicode-yes-no' => array('✔', '✖'),
'custom' => array(t('Custom')),
);
and the code which renders the label then looks like that:
return !empty($value) ? $formats[$format][1] : $formats[$format][0];
Let's assume we have the boolean value == TRUE the first case will be used, which returns no. Sounds pretty important for that module ;)
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | boolean_formatter-2012770-1.patch | 483 bytes | dawehner |
Comments
Comment #1
dawehnerHere is a fix.
Comment #2
timonweb commentedI confirm that such bug exists and this patch fixes it. Thanks for your contribution!
Comment #3
dave reidConfirmed and committed #1 to 7.x-1.x. http://drupalcode.org/project/boolean_formatter.git/commit/e3826f2