By yched on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.0.x
Issue links:
Description:
The 'list_boolean' field type, provided by options.module in Drupal 7, has been replaced / merged in Drupal 8 with the 'boolean' field type (BooleanItem) provided by Core in Drupal 8.
- Unlike the Drupal 7 'list_boolean' field type, which could be configured to use any two arbitrary integers as "on" and "off" values, the 'boolean' field type only stores 0 or 1. The human readable labels for those values can still be configured as field settings:
Drupal 7 settings for 'list_boolean' :
array(
'allowed_values' => array(12 => 'Please no', 47 => 'Yes, sure'),
)
Drupal 8 settings for 'boolean' :
array(
'on_label' => 'Yes, sure', // will be stored as 1
'off_label' => 'Please no', // will be stored as 0
)
- The 'options_onoff' ("Single on/off checkbox") widget has been renamed to 'boolean_checkbox'.
- A dedicated 'boolean' formatter has been added for the field type.
Impacts:
Site builders, administrators, editors
Module developers