You are here

function eu_cookie_compliance_update_8115 in EU Cookie Compliance (GDPR Compliance) 8

Renaming variables show_disagree_button and popup_disagree_button_message.

File

./eu_cookie_compliance.install, line 368
Update scripts for the EU Cookie Compliance module.

Code

function eu_cookie_compliance_update_8115() {
  $show_disagree_button = \Drupal::configFactory()
    ->getEditable('eu_cookie_compliance.settings')
    ->get('show_disagree_button');
  $popup_disagree_button_message = \Drupal::configFactory()
    ->getEditable('eu_cookie_compliance.settings')
    ->get('popup_disagree_button_message');
  if (!empty($show_disagree_button)) {
    \Drupal::configFactory()
      ->getEditable('eu_cookie_compliance.settings')
      ->set('show_more_info', $show_disagree_button)
      ->save();
    \Drupal::configFactory()
      ->getEditable('eu_cookie_compliance.settings')
      ->clear('show_disagree_button')
      ->save();
  }
  if (!empty($popup_disagree_button_message)) {
    \Drupal::configFactory()
      ->getEditable('eu_cookie_compliance.settings')
      ->set('popup_more_info_button_message', $popup_disagree_button_message)
      ->save();
    \Drupal::configFactory()
      ->getEditable('eu_cookie_compliance.settings')
      ->clear('popup_disagree_button_message')
      ->save();
  }
}