Version 1
[yaffs-website] / web / core / modules / field / tests / fixtures / update / drupal-8.email_widget_size_setting-2578741.php
diff --git a/web/core/modules/field/tests/fixtures/update/drupal-8.email_widget_size_setting-2578741.php b/web/core/modules/field/tests/fixtures/update/drupal-8.email_widget_size_setting-2578741.php
new file mode 100644 (file)
index 0000000..ca762bc
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * @file
+ * Contains SQL necessary to add a new component for an email field/widget to
+ * the 'node.article.default' entity form display.
+ */
+
+use Drupal\Core\Database\Database;
+
+$connection = Database::getConnection();
+
+$config = $connection->select('config', 'c')
+  ->fields('c')
+  ->condition('collection', '')
+  ->condition('name', 'core.entity_form_display.node.article.default')
+  ->execute()
+  ->fetchAssoc();
+
+$data = unserialize($config['data']);
+
+// Manually add a new component that simulates an email field using the default
+// email widget.
+$data['content']['field_email_2578741'] = [
+  'weight' => 20,
+  'settings' => [
+    'placeholder' => '',
+  ],
+  'third_party_settings' => [],
+  'type' => 'email_default',
+];
+
+$connection->update('config')
+  ->fields(['data' => serialize($data)])
+  ->condition('collection', '')
+  ->condition('name', 'core.entity_form_display.node.article.default')
+  ->execute();