diff --git a/Classes/Controller/JavaScriptController.php b/Classes/Controller/JavaScriptController.php index 0ff8a67..29720f1 100644 --- a/Classes/Controller/JavaScriptController.php +++ b/Classes/Controller/JavaScriptController.php @@ -84,7 +84,14 @@ function ($key) { $q = new FlowQuery([$siteNode]); - $consentDate = new \DateTime(isset($cookie['consentDates'][$dimensionIdentifier]) ? $cookie['consentDates'][$dimensionIdentifier] : $cookie['consentDate']); + if (isset($cookie['consentDates'][$dimensionIdentifier])) { + $consentDate = new \DateTime($cookie['consentDates'][$dimensionIdentifier]); + } elseif (isset($cookie['consentDate'])) { + $consentDate = new \DateTime($cookie['consentDate']); + } else { + $consentDate = new \DateTime('now'); + } + $cookieSettings = $q->find('[instanceof KaufmannDigital.GDPR.CookieConsent:Content.CookieSettings]')->get(0); if (!$cookieSettings instanceof NodeInterface) {