You are here

function eu_cookie_compliance_update_7010 in EU Cookie Compliance (GDPR Compliance) 7

Same name and namespace in other branches
  1. 7.2 eu_cookie_compliance.install \eu_cookie_compliance_update_7010()

Ensure that all "eu_cookie_compliance" parameters have a default value.

File

./eu_cookie_compliance.install, line 457
Installation file.

Code

function eu_cookie_compliance_update_7010() {
  $settings = variable_get('eu_cookie_compliance', array());
  $updated_setting = $settings + _eu_cookie_compliance_get_popup_default_setting();
  variable_set('eu_cookie_compliance', $updated_setting);
  if (module_exists('i18n_variable')) {
    $languages = language_list();
    foreach (array_keys($languages) as $langcode) {
      $settings = i18n_variable_get('eu_cookie_compliance', $langcode);
      if (!empty($settings)) {
        $updated_setting = $settings + _eu_cookie_compliance_get_popup_default_setting();
        variable_realm_set('language', $langcode, 'eu_cookie_compliance', $updated_setting, FALSE);
      }
    }
  }
}