You are here

function eu_cookie_compliance_update_8103 in EU Cookie Compliance (GDPR Compliance) 8

Fix bug with mobile banner message from beta 9.

File

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

Code

function eu_cookie_compliance_update_8103() {
  $mobile_popup_info = \Drupal::configFactory()
    ->get('eu_cookie_compliance.settings')
    ->get('mobile_popup_info');
  if (!is_array($mobile_popup_info) && $mobile_popup_info == '') {
    \Drupal::configFactory()
      ->getEditable('eu_cookie_compliance.settings')
      ->set('mobile_popup_info', [
      'value' => '',
      'format' => filter_default_format(),
    ])
      ->save();
  }
}