diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
index 2ea450d..b5182bc 100644
--- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
+++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
@@ -1257,7 +1257,9 @@ protected function saveToDedicatedTables(ContentEntityInterface $entity, $update
           foreach ($storage_definition->getColumns() as $column => $attributes) {
             $column_name = $table_mapping->getFieldColumnName($storage_definition, $column);
             // Serialize the value if specified in the column schema.
-            $record[$column_name] = !empty($attributes['serialize']) ? serialize($item->$column) : $item->$column;
+            $value = drupal_schema_get_field_value($attributes, $item->$column);
+            $record[$column_name] = !empty($attributes['serialize'])
+              ? serialize($value) : $value;
           }
           $query->values($record);
           if ($this->entityType->isRevisionable()) {
diff --git a/core/modules/field/src/Tests/Boolean/BooleanFieldTest.php b/core/modules/field/src/Tests/Boolean/BooleanFieldTest.php
index 30f67d1..b432057 100644
--- a/core/modules/field/src/Tests/Boolean/BooleanFieldTest.php
+++ b/core/modules/field/src/Tests/Boolean/BooleanFieldTest.php
@@ -20,7 +20,12 @@ class BooleanFieldTest extends WebTestBase {
    *
    * @var array
    */
-  public static $modules = array('entity_test', 'field_ui', 'options');
+  public static $modules = [
+    'entity_test',
+    'field_ui',
+    'options',
+    'deny_access'
+  ];
 
   /**
    * A field to use in this test class.
@@ -179,4 +184,36 @@ function testBooleanField() {
     $this->assertFieldById('edit-settings-off-label', $off);
   }
 
+  /**
+   * Test form access.
+   */
+  public function testFormAccess() {
+    $field_name = 'booleanmachinename';
+    $this->fieldStorage = FieldStorageConfig::create(array(
+      'field_name' => $field_name,
+      'entity_type' => 'entity_test',
+      'type' => 'boolean',
+    ));
+    $this->fieldStorage->save();
+
+    // Create a form display for the default form mode.
+    entity_get_form_display('entity_test', 'entity_test', 'default')
+      ->setComponent($field_name, array(
+        'type' => 'boolean_checkbox',
+      ))
+      ->save();
+
+    // Create a display for the full view mode.
+    entity_get_display('entity_test', 'entity_test', 'full')
+      ->setComponent($field_name, array(
+        'type' => 'boolean',
+      ))
+      ->save();
+
+    // Display creation form.
+    $this->drupalGet('entity_test/add');
+    $this->assertFieldByName("{$field_name}[value]");
+    $this->assertRaw('booleanmachinename');
+  }
+
 }
diff --git a/core/modules/system/tests/modules/form_test/form_test.module b/core/modules/system/tests/modules/form_test/form_test.module
index 7114a29..54ec9dc 100644
--- a/core/modules/system/tests/modules/form_test/form_test.module
+++ b/core/modules/system/tests/modules/form_test/form_test.module
@@ -21,6 +21,9 @@ function form_test_form_alter(&$form, FormStateInterface $form_state, $form_id)
   if ($form_id == 'form_test_alter_form') {
     drupal_set_message('form_test_form_alter() executed.');
   }
+
+  $form['booleanmachinename']['#acess'] = FALSE;
+
 }
 
 /**
