You are here

function avatars_update_8003 in Avatar Kit 8

Update generator preference field to new widget.

Remove allowed_values_function.

File

./avatars.install, line 146
Install, update and uninstall functions for the AK module.

Code

function avatars_update_8003() {

  /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $displayRepo */
  $displayRepo = \Drupal::service('entity_display.repository');
  $displayRepo
    ->getFormDisplay('user', 'user', 'default')
    ->setComponent(AK_FIELD_AVATAR_GENERATOR, [
    'type' => 'avatars_generator_preview',
  ])
    ->save();
}