You are here

function _cms_content_sync_views_update_config in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x modules/cms_content_sync_views/cms_content_sync_views.install \_cms_content_sync_views_update_config()
  2. 2.0.x modules/cms_content_sync_views/cms_content_sync_views.install \_cms_content_sync_views_update_config()

Re-import the given config to reset it to defaults when they're changed in the module.

Parameters

$configsNames:

2 calls to _cms_content_sync_views_update_config()
cms_content_sync_views_update_8002 in modules/cms_content_sync_views/cms_content_sync_views.install
Add new action configurations.
cms_content_sync_views_update_8003 in modules/cms_content_sync_views/cms_content_sync_views.install
Add new action configurations.

File

modules/cms_content_sync_views/cms_content_sync_views.install, line 16
Install file for cms_content_sync_views.

Code

function _cms_content_sync_views_update_config($configsNames) {
  $config_path = drupal_get_path('module', 'cms_content_sync_views') . '/config/install';
  $source = new FileStorage($config_path);
  $config_storage = Drupal::service('config.storage');
  $config_factory = Drupal::configFactory();
  $uuid_service = Drupal::service('uuid');
  foreach ($configsNames as $name) {
    $config_storage
      ->write($name, $source
      ->read($name));
    $config_factory
      ->getEditable($name)
      ->set('uuid', $uuid_service
      ->generate())
      ->save();
  }
}