You are here

function cookiebot_update_8001 in Cookiebot - Cookie consent, Cookie monitoring and Cookie control 8

Update configuration keys.

File

./cookiebot.install, line 11
Contains install, update and uninstall hooks.

Code

function cookiebot_update_8001() {
  $config = \Drupal::configFactory()
    ->getEditable('cookiebot.settings');
  $config
    ->set('cookiebot_show_declaration', $config
    ->get('cookiebot_allow_declaration'));
  $config
    ->clear('cookiebot_allow_declaration');
  $config
    ->set('cookiebot_show_declaration_node_id', $config
    ->get('cookiebot_declaration_path'));
  $config
    ->clear('cookiebot_declaration_path');
  $config
    ->save();
}