Skip to content

Commit

Permalink
fix: warning if array is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
hphoeksma authored and Nikdro committed Jan 4, 2023
1 parent 0de0d58 commit 260f5ec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Classes/Controller/JavaScriptController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 260f5ec

Please sign in to comment.