From 53b3c878ce7ac76a65d8074ddeea207ddc182ec5 Mon Sep 17 00:00:00 2001 From: MaxBuhe01 Date: Sat, 21 Sep 2024 16:08:08 +0200 Subject: [PATCH] [Fixed] Consentmanager doesn't get delivered false value given for important decision-making. Since the value was false, we got "false" as return for D3blShowGtmScript() which made consentmanager not send the data to GTM --- Application/Model/ManagerTypes.php | 19 +++++++++++++++++++ Modules/Core/ViewConfig.php | 14 ++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/Application/Model/ManagerTypes.php b/Application/Model/ManagerTypes.php index 5db77ff..899dea9 100644 --- a/Application/Model/ManagerTypes.php +++ b/Application/Model/ManagerTypes.php @@ -16,6 +16,7 @@ class ManagerTypes const AGCOOKIECOMPLIANCE = "Aggrosoft Cookie Compliance"; const CONSENTMANAGER = "Consentmanager"; + const INTERNAL_CONSENTMANAGER = "cmconsentmanager"; const COOKIEFIRST = "Cookiefirst"; @@ -46,4 +47,22 @@ class ManagerTypes { return in_array($sManager, array_keys($this->getManagerList()), true); } + + /** + * @return array + * + * the CMP from this method always needs the script tag delivered to the dom. + */ + public function scriptTagDeliveredByDefaultArray() :array + { + return [ + Usercentrics::sModuleIncludationInternalName, + Usercentrics::sExternalIncludationInternalName, + ManagerTypes::CONSENTMANAGER, + ManagerTypes::INTERNAL_CONSENTMANAGER, + ManagerTypes::COOKIEFIRST, + ManagerTypes::COOKIEBOT, + ManagerTypes::EXTERNAL_SERVICE + ]; + } } \ No newline at end of file diff --git a/Modules/Core/ViewConfig.php b/Modules/Core/ViewConfig.php index ac7b754..b4cf47a 100644 --- a/Modules/Core/ViewConfig.php +++ b/Modules/Core/ViewConfig.php @@ -101,15 +101,13 @@ class ViewConfig extends ViewConfig_parent return $this->isCookieCategoryEnabled($sCookieID); } } - - // UserCentrics or consentmanager + if ( - $this->sCookieManagerType === Usercentrics::sModuleIncludationInternalName - or $this->sCookieManagerType === Usercentrics::sExternalIncludationInternalName - or $this->sCookieManagerType === ManagerTypes::CONSENTMANAGER - or $this->sCookieManagerType === ManagerTypes::COOKIEFIRST - or $this->sCookieManagerType === ManagerTypes::COOKIEBOT - or $this->sCookieManagerType === ManagerTypes::EXTERNAL_SERVICE + in_array + ( + $this->sCookieManagerType, + (oxNew(ManagerTypes::class)->scriptTagDeliveredByDefaultArray()) + ) ) { // Always needs the script-tags delivered to the DOM.