diff --git a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme index 33d47533..35ae023b 100644 --- a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme +++ b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme @@ -107,7 +107,12 @@ function hdbt_subtheme_preprocess_paragraph__journey_planner(array &$variables): $variables['media_id'] = 'journey-map'; // Set the privacy policy URL. - /** @var \Drupal\hdbt_cookie_banner\Services\CookieSettings $cookie_settings */ - $cookie_settings = \Drupal::service('hdbt_cookie_banner.cookie_settings'); - $variables['privacy_policy_url'] = $cookie_settings->getCookieSettingsPageUrl(); + if (Drupal::moduleHandler()->moduleExists('hdbt_cookie_banner')) { + $cookie_settings = Drupal::service('hdbt_cookie_banner.cookie_settings'); + $variables['privacy_policy_url'] = $cookie_settings->getCookieSettingsPageUrl(); + } + // @todo UHF-10862 Remove once the HDBT cookie banner module is in use. + elseif (Drupal::moduleHandler()->moduleExists('helfi_eu_cookie_compliance')) { + $variables['privacy_policy_url'] = helfi_eu_cookie_compliance_get_privacy_policy_url(); + } }