function eu_cookie_compliance_update_8110 in EU Cookie Compliance (GDPR Compliance) 8
Disable withdraw tab and banner in the consent method "Consent by default".
File
- ./
eu_cookie_compliance.install, line 327 - Update scripts for the EU Cookie Compliance module.
Code
function eu_cookie_compliance_update_8110() {
$withdraw_enabled = \Drupal::configFactory()
->get('eu_cookie_compliance.settings')
->get('withdraw_enabled');
$method = \Drupal::configFactory()
->get('eu_cookie_compliance.settings')
->get('method');
if ($method === 'default' && $withdraw_enabled == 1) {
\Drupal::configFactory()
->getEditable('eu_cookie_compliance.settings')
->set('withdraw_enabled', FALSE)
->save();
}
}