You are here

function charts_update_8301 in Charts 8.4

Same name and namespace in other branches
  1. 5.0.x charts.install \charts_update_8301()

Update existing default config.

File

./charts.install, line 22
Install and update functions for the Charts module.

Code

function charts_update_8301() {

  /** @var \Drupal\Core\Config\Config $default_config */
  $config = \Drupal::service('config.factory')
    ->getEditable('charts.settings');
  if ($config && ($default_settings = $config
    ->get('charts_default_settings'))) {
    $config
      ->set('charts_default_settings', ChartsDefaultSettings::transformLegacySettingsToNew($default_settings));
    $config
      ->save();
  }
}