5 * Contains SQL necessary to add a new component for an email field/widget to
6 * the 'node.article.default' entity form display.
9 use Drupal\Core\Database\Database;
11 $connection = Database::getConnection();
13 $config = $connection->select('config', 'c')
15 ->condition('collection', '')
16 ->condition('name', 'core.entity_form_display.node.article.default')
20 $data = unserialize($config['data']);
22 // Manually add a new component that simulates an email field using the default
24 $data['content']['field_email_2578741'] = [
29 'third_party_settings' => [],
30 'type' => 'email_default',
33 $connection->update('config')
34 ->fields(['data' => serialize($data)])
35 ->condition('collection', '')
36 ->condition('name', 'core.entity_form_display.node.article.default')