You are here

function avatars_update_8002 in Avatar Kit 8

Remove persist after field instance delete for preference field.

This was preventing re-install of module

File

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

Code

function avatars_update_8002() {
  $config_factory = \Drupal::configFactory();
  if ($field_storage = $config_factory
    ->getEditable('field.storage.user.avatars_avatar_generator')) {
    $field_storage
      ->set('persist_with_no_fields', FALSE)
      ->save();
  }
}