diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php index 52583c7..517509a 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php @@ -19,13 +19,6 @@ * id = "boolean", * label = @Translation("Boolean"), * description = @Translation("An entity field containing a boolean value."), - * settings = { - * "allowed_values" = { - * "0" = 0, - * "1" = 1 - * }, - * "allowed_values_function" = "" - * }, * default_widget = "boolean", * default_formatter = "number_unformatted", * ) @@ -35,6 +28,16 @@ class BooleanItem extends FieldItemBase { /** * {@inheritdoc} */ + public static function defaultSettings() { + return array( + 'allowed_values' => array(0, 1), + 'allowed_values_function' => '', + ) + parent::defaultSettings(); +} + + /** + * {@inheritdoc} + */ public static function propertyDefinitions(FieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('boolean') ->setLabel(t('Boolean value'));