You are here

function data_policy_update_8001 in Data Policy 8

Display Name field on the edit form.

File

./data_policy.install, line 40
Install, update and uninstall functions for the data_policy module.

Code

function data_policy_update_8001() {
  $config_factory = \Drupal::configFactory();
  $config = $config_factory
    ->getEditable('core.entity_form_display.data_policy.data_policy.default');
  $data = $config
    ->getRawData();
  $data['content']['name'] = [
    'type' => 'string_textfield',
    'weight' => -1,
    'settings' => [
      'size' => 60,
      'placeholder' => '',
    ],
    'third_party_settings' => [],
    'region' => 'content',
  ];
  $config
    ->setData($data);
  $config
    ->save(TRUE);
}