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 ;)

CommentFileSizeAuthor
#1 boolean_formatter-2012770-1.patch483 bytesdawehner

Comments

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new483 bytes

Here is a fix.

timonweb’s picture

I confirm that such bug exists and this patch fixes it. Thanks for your contribution!

dave reid’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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