You are here

function opigno_skills_system_update_8003 in Opigno module 8

Update skills vocabulary.

File

modules/opigno_skills_system/opigno_skills_system.install, line 108
Install, update and uninstall functions for the Opigno skills system module.

Code

function opigno_skills_system_update_8003() {
  $config_path = drupal_get_path('module', 'opigno_skills_system') . '/config/optional';
  $storage = new FileStorage($config_path);
  $config_storage = \Drupal::service('config.storage');
  $data = $storage
    ->read('taxonomy.vocabulary.skills');
  $config_storage
    ->write('taxonomy.vocabulary.skills', $data);
  $data = $storage
    ->read('core.entity_form_display.taxonomy_term.skills.default');
  $config_storage
    ->write('core.entity_form_display.taxonomy_term.skills.default', $data);
  $data = $storage
    ->read('core.entity_view_display.taxonomy_term.skills.default');
  $config_storage
    ->write('core.entity_view_display.taxonomy_term.skills.default', $data);
  $data = $storage
    ->read('field.field.taxonomy_term.skills.field_minimum_count_of_answers');
  $config_storage
    ->write('field.field.taxonomy_term.skills.field_minimum_count_of_answers', $data);
  $data = $storage
    ->read('field.field.taxonomy_term.skills.field_minimum_score');
  $config_storage
    ->write('field.field.taxonomy_term.skills.field_minimum_score', $data);
  $data = $storage
    ->read('field.storage.taxonomy_term.field_level_names');
  $config_storage
    ->write('field.storage.taxonomy_term.field_level_names', $data);
}