You are here

function contact_storage_update_8202 in Contact Storage 8

Fix the last installed definition for the 'contact_message' entity type.

File

./contact_storage.install, line 132
Contains install and update hooks.

Code

function contact_storage_update_8202() {
  $entity_type = \Drupal::entityDefinitionUpdateManager()
    ->getEntityType('contact_message');
  $keys = $entity_type
    ->getKeys();
  if (empty($keys['langcode'])) {
    $keys['langcode'] = 'langcode';
    $entity_type
      ->set('entity_keys', $keys);
    \Drupal::entityDefinitionUpdateManager()
      ->updateEntityType($entity_type);
  }
}