You are here

function eu_cookie_compliance_requirements in EU Cookie Compliance (GDPR Compliance) 8

Same name and namespace in other branches
  1. 7.2 eu_cookie_compliance.install \eu_cookie_compliance_requirements()
  2. 7 eu_cookie_compliance.install \eu_cookie_compliance_requirements()
  3. 2.0.x eu_cookie_compliance.install \eu_cookie_compliance_requirements()

Implements hook_requirements().

File

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

Code

function eu_cookie_compliance_requirements($phase) {
  $requirements = [];
  if ($phase === 'runtime') {
    $popup_link = Drupal::config('eu_cookie_compliance.settings')
      ->get('popup_link');
    $show_policy = Drupal::config('eu_cookie_compliance.settings')
      ->get('show_disagree_button');
    if ($popup_link === '<front>' && $show_policy) {
      $requirements['eu_cookie_compliance'] = [
        'title' => t('EU Cookie Compliance'),
        'severity' => REQUIREMENT_WARNING,
        'description' => t('Your privacy policy link is pointing at the front page. This is the default value after installation, and unless your privacy policy is actually posted at the front page, you will need to create a separate page for the privacy policy and link to that page.'),
        'value' => t('Privacy policy link not provided'),
      ];
    }
  }
  return $requirements;
}