From b5c66f78068298ffffd8c5b116cca04edd6fa6f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 22 Nov 2024 09:19:37 +0200 Subject: [PATCH 1/2] Added fallback to EU cookie compliance module. --- public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme index 33d47533..1c131ccb 100644 --- a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme +++ b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme @@ -108,6 +108,12 @@ function hdbt_subtheme_preprocess_paragraph__journey_planner(array &$variables): // 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(); + } } From d804af9ad76cdf6bd76f107ee3bc57d5f839558f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 22 Nov 2024 09:26:32 +0200 Subject: [PATCH 2/2] Removed PHPDoc tag. --- public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme | 1 - 1 file changed, 1 deletion(-) diff --git a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme index 1c131ccb..35ae023b 100644 --- a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme +++ b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme @@ -107,7 +107,6 @@ 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 */ if (Drupal::moduleHandler()->moduleExists('hdbt_cookie_banner')) { $cookie_settings = Drupal::service('hdbt_cookie_banner.cookie_settings'); $variables['privacy_policy_url'] = $cookie_settings->getCookieSettingsPageUrl();