You are here

function opigno_learning_path_update_8009 in Opigno Learning path 8

Update view and media_browser_widget configs.

File

./opigno_learning_path.install, line 306
Install, update and uninstall functions for the module.

Code

function opigno_learning_path_update_8009() {
  $config_path = drupal_get_path('module', 'opigno_learning_path') . '/config/optional';

  /* @var Drupal\Core\Config\CachedStorage $config_storage */
  $storage = new FileStorage($config_path);
  $config_storage = \Drupal::service('config.storage');
  $configs = [
    'entity_browser.browser.media_entity_browser_groups',
    'views.view.media_browser_images',
  ];
  foreach ($configs as $item) {
    $data = $storage
      ->read($item);
    $config_storage
      ->write($item, $data);
  }
}