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 1baf7bd..563da20 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php @@ -31,11 +31,11 @@ class BooleanItem extends FieldItemBase implements OptionsProviderInterface { /** * {@inheritdoc} */ - public static function defaultStorageSettings() { + public static function defaultFieldSettings() { return array( 'on_label' => t('On'), 'off_label' => t('Off'), - ) + parent::defaultStorageSettings(); + ) + parent::defaultFieldSettings(); } /** @@ -66,7 +66,9 @@ public static function schema(FieldStorageDefinitionInterface $field_definition) /** * {@inheritdoc} */ - public function storageSettingsForm(array &$form, FormStateInterface $form_state, $has_data) { + public function fieldSettingsForm(array $form, FormStateInterface $form_state) { + $element = array(); + $element['on_label'] = array( '#type' => 'textfield', '#title' => $this->t('"On" label'), diff --git a/core/modules/field/src/Tests/Boolean/BooleanFieldTest.php b/core/modules/field/src/Tests/Boolean/BooleanFieldTest.php index 50477f5..9b142b7 100644 --- a/core/modules/field/src/Tests/Boolean/BooleanFieldTest.php +++ b/core/modules/field/src/Tests/Boolean/BooleanFieldTest.php @@ -69,10 +69,6 @@ function testBooleanField() { 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'boolean', - 'settings' => array( - 'on_label' => $on, - 'off_label' => $off, - ), )); $this->field_storage->save(); $this->field = FieldConfig::create(array( @@ -81,6 +77,10 @@ function testBooleanField() { 'bundle' => 'entity_test', 'label' => $label, 'required' => TRUE, + 'settings' => array( + 'on_label' => $on, + 'off_label' => $off, + ), )); $this->field->save(); diff --git a/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php b/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php index 9fcbca5..c5ed0fe 100644 --- a/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php +++ b/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php @@ -58,10 +58,6 @@ protected function setUp() { 'entity_type' => 'node', 'type' => 'boolean', 'cardinality' => 1, - 'settings' => array( - 'on_label' => 'Private', - 'off_label' => 'Not private', - ), )); $field_storage->save(); @@ -71,6 +67,10 @@ protected function setUp() { 'widget' => array( 'type' => 'options_buttons', ), + 'settings' => array( + 'on_label' => 'Private', + 'off_label' => 'Not private', + ), ))->save(); // After enabling a node access module, the access table has to be rebuild. diff --git a/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php b/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php index 77d8ce9..a9ee922 100644 --- a/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php +++ b/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php @@ -56,10 +56,6 @@ protected function setUp() { 'entity_type' => 'node', 'type' => 'boolean', 'cardinality' => 1, - 'settings' => array( - 'on_label' => 'Private', - 'off_label' => 'Not private', - ), )); $field_storage->save(); @@ -69,6 +65,10 @@ protected function setUp() { 'widget' => array( 'type' => 'options_buttons', ), + 'settings' => array( + 'on_label' => 'Private', + 'off_label' => 'Not private', + ), ))->save(); // After enabling a node access module, the access table has to be rebuild.