From 1356f2f0e74d3eff372fed424e31e8a0f48b306c Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Fri, 31 May 2024 11:57:46 +0200 Subject: [PATCH 01/18] [Added] Container-ID explanation to docs --- Docs/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Docs/README.md b/Docs/README.md index 29b581b..e214985 100644 --- a/Docs/README.md +++ b/Docs/README.md @@ -5,6 +5,13 @@ Die Einbindung dieser Event-Templates erfolgt über TPL-Blöcke unter `source/mo *Hinweis: nicht alle templates sind bereits gefüllt. Wünschen Sie die Implementierung eines unausgefüllten templates? Kommen Sie auf uns zu unter https://www.d3data.de/ +## Container-ID +Diese finden Sie im "Google-Tag-Manager"-Arbeitsbereich in der Navigationsleiste. +Sie beginnt mit GTM, gefolgt von einem Bindestrich und einer Zeichenkette. + +Diese ID wird benötigt, um Google anzuweise, zu welchem "Google Tag Manager"-Arbeitsbereich die +gesammelten Daten im Daten-Stream geleitet werden sollen. + ## Steuerungsparameter Tragen Sie hier im Normalfall die ID des zu prüfenden Cookies ein. In bestimmten Fällen, müssen Sie hier alternative Werte eintragen. Diese Fälle sind bedingt From bbd7b5ec95625b8702befc91b642aa1e577eb9d0 Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Fri, 31 May 2024 11:58:00 +0200 Subject: [PATCH 02/18] [Added] extended translations/ explanations --- .../admin/de/d3googleanalytics4_lang.php | 4 +- .../admin/tpl/d3googleanalytics4_main.tpl | 38 +++++++++++-------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/Application/views/admin/de/d3googleanalytics4_lang.php b/Application/views/admin/de/d3googleanalytics4_lang.php index 64509a2..eecd91d 100644 --- a/Application/views/admin/de/d3googleanalytics4_lang.php +++ b/Application/views/admin/de/d3googleanalytics4_lang.php @@ -14,8 +14,10 @@ $aLang = array( 'D3CLOSE' => 'Schließen', 'D3NONE' => '- keinen -', 'D3CONTAINERID' => 'Container-ID', + 'D3CONTAINERID_HELP' => ' Was ist die Container-ID?', 'D3ACTIVATEMOD' => 'Modul aktivieren', 'D3CNTRLPARAM' => 'Steuerungsparameter', + 'D3CNTRLPARAM_HELP' => ' Was ist der Steuerungsparameter?', 'D3INACTIVATEMOD' => 'Modul ist nicht aktiv! Es werde keine Funktionen ausgespielt!', // Usercentrics Dynamische Optionen 'D3USRCNTRCSDYNOPT' => 'Usercentrics Dynamische Optionen', @@ -56,7 +58,7 @@ $aLang = array( offizieller Partnerschaft mit Google ( Liste der Partner ) und unterliegen strengen Vorschriften, um ein ordnungsgemäßes Senden und Verarbeiten der Zustimmung unterliegenden Daten sicher zu stellen.', - 'D3CMP' => 'Consent Management Platform ( CMP )', + 'D3CMP' => 'Consent Management Platform ( CMP ) wählen', // Usercentrics Config // activate Individual Default Values diff --git a/Application/views/admin/tpl/d3googleanalytics4_main.tpl b/Application/views/admin/tpl/d3googleanalytics4_main.tpl index 6fb3fab..6e141e8 100644 --- a/Application/views/admin/tpl/d3googleanalytics4_main.tpl +++ b/Application/views/admin/tpl/d3googleanalytics4_main.tpl @@ -35,9 +35,12 @@ [{oxmultilang ident="D3ACTIVATEMOD"}] [{if false === $d3ViewObject->d3GetModuleConfigParam('_blEnableGa4')}][{oxmultilang ident="D3INACTIVATEMOD"}][{/if}] -
- [{oxmultilang ident="D3CONTAINERID"}] - +
+
+ [{oxmultilang ident="D3CONTAINERID"}] + +
+
[{oxmultilang ident="D3CONTAINERID_HELP"}]
d3GetModuleConfigParam('_blEnableDebug')}]checked[{/if}]> @@ -72,19 +75,24 @@ [{oxmultilang ident="D3CMPUSEQ"}][{oxinputhelp ident="D3CMPUSEQ_HELP"}]
-
- [{oxmultilang ident="D3CNTRLPARAM"}] - +
+ + +
+
+
+ [{oxmultilang ident="D3CNTRLPARAM"}] + +
+
[{oxmultilang ident="D3CNTRLPARAM_HELP"}]
- -
From 1dd353ce58cf96a866eb42e16b7e82348fac66c2 Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Fri, 31 May 2024 15:18:26 +0200 Subject: [PATCH 03/18] [Changed] Usercentrics-Class constants and adjust glob-code to it --- Application/Model/CMP/Usercentrics.php | 15 +++++++++++++-- Application/Model/ManagerTypes.php | 26 +++++++------------------- Modules/Core/ViewConfig.php | 15 +++++++++------ 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/Application/Model/CMP/Usercentrics.php b/Application/Model/CMP/Usercentrics.php index 2c4cba4..9e13404 100644 --- a/Application/Model/CMP/Usercentrics.php +++ b/Application/Model/CMP/Usercentrics.php @@ -7,8 +7,19 @@ namespace D3\GoogleAnalytics4\Application\Model\CMP; use D3\GoogleAnalytics4\Application\Model\ManagerTypes; +/** + * Used the OXID Module. + * + * Further information's: + * https://docs.oxid-esales.com/modules/usercentrics/de/latest/einfuehrung.html + * + * Usercentrics homepage: + * https://usercentrics.com + */ class Usercentrics extends ConsentManagementPlatformBaseModel { - const sCMPName = ManagerTypes::USERCENTRICS_MANUALLY; - const sAlternatename = ManagerTypes::USERCENTRICS_MODULE; + const sExternalIncludationPublicName = "( Externe Einbindung ) Usercentrics"; + const sExternalIncludationInternalName = "usercentrics"; + const sModuleIncludationPublicName = "( Modul ) Usercentrics"; + const sModuleIncludationInternalName = "oxps_usercentrics"; } \ No newline at end of file diff --git a/Application/Model/ManagerTypes.php b/Application/Model/ManagerTypes.php index f12af76..191c9c5 100644 --- a/Application/Model/ManagerTypes.php +++ b/Application/Model/ManagerTypes.php @@ -2,6 +2,8 @@ namespace D3\GoogleAnalytics4\Application\Model; +use D3\GoogleAnalytics4\Application\Model\CMP\Usercentrics; + class ManagerTypes { #ToDo: make own classes for each of the manager @@ -14,23 +16,9 @@ class ManagerTypes * Further information's: * https://github.com/aggrosoft/oxid-cookie-compliance */ - const AGCOOKIECOMPLIANCE = "agcookiecompliance"; + const AGCOOKIECOMPLIANCE = "Aggrosoft Cookie Compliance"; - /** - * Used the OXID Module. - * - * Further information's: - * https://docs.oxid-esales.com/modules/usercentrics/de/latest/einfuehrung.html - * - * Usercentrics homepage: - * https://usercentrics.com - */ - const USERCENTRICS_MODULE = "oxps_usercentrics"; - - /** - * manually included usercentrics script - */ - const USERCENTRICS_MANUALLY = "USERCENTRICS"; + const CONSENTMANAGER = "Consentmanager"; const CONSENTMANAGER = "CONSENTMANAGER"; @@ -47,9 +35,9 @@ class ManagerTypes "externalService" => self::EXTERNAL_SERVICE, "agcookiecompliance" => self::AGCOOKIECOMPLIANCE, "net_cookie_manager" => self::NET_COOKIE_MANAGER, - "oxps_usercentrics" => self::USERCENTRICS_MODULE, - "usercentrics" => self::USERCENTRICS_MANUALLY, - "consentmanager" => self::CONSENTMANAGER, + Usercentrics::sModuleIncludationInternalName => Usercentrics::sModuleIncludationPublicName, + Usercentrics::sExternalIncludationInternalName => Usercentrics::sExternalIncludationPublicName, + "cmconsentmanager" => self::CONSENTMANAGER, "cookiefirst" => self::COOKIEFIRST, "cookiebot" => self::COOKIEBOT, ]; diff --git a/Modules/Core/ViewConfig.php b/Modules/Core/ViewConfig.php index d5f294c..3ff33db 100644 --- a/Modules/Core/ViewConfig.php +++ b/Modules/Core/ViewConfig.php @@ -104,8 +104,8 @@ class ViewConfig extends ViewConfig_parent // UserCentrics or consentmanager if ( - $this->sCookieManagerType === ManagerTypes::USERCENTRICS_MODULE - or $this->sCookieManagerType === ManagerTypes::USERCENTRICS_MANUALLY + $this->sCookieManagerType === Usercentrics::sModuleIncludationInternalName + or $this->sCookieManagerType === Usercentrics::sExternalIncludationInternalName or $this->sCookieManagerType === ManagerTypes::CONSENTMANAGER or $this->sCookieManagerType === ManagerTypes::COOKIEFIRST or $this->sCookieManagerType === ManagerTypes::COOKIEBOT @@ -134,8 +134,8 @@ class ViewConfig extends ViewConfig_parent } if ( - $this->sCookieManagerType === ManagerTypes::USERCENTRICS_MODULE - or $this->sCookieManagerType === ManagerTypes::USERCENTRICS_MANUALLY + $this->sCookieManagerType === Usercentrics::sModuleIncludationInternalName + or $this->sCookieManagerType === Usercentrics::sExternalIncludationInternalName ) { return 'data-usercentrics="' . $sControlParameter . '" type="text/plain" async=""'; @@ -252,7 +252,10 @@ class ViewConfig extends ViewConfig_parent */ public function d3IsUsercentricsCMPChosen() :bool { - return (bool) ($this->d3GetModuleConfigParam('_HAS_STD_MANAGER') === Usercentrics::sCMPName - or $this->d3GetModuleConfigParam('_HAS_STD_MANAGER') === Usercentrics::sAlternatename); + $sCMPPubName = $this->d3GetModuleConfigParam('_HAS_STD_MANAGER'); + $aPossibleCMP = (oxNew(ManagerTypes::class))->getManagerList(); + + return (bool) ($sCMPPubName === Usercentrics::sExternalIncludationInternalName + or $sCMPPubName === Usercentrics::sModuleIncludationInternalName); } } \ No newline at end of file From 0dc55656409533148e76789e75a1fe0f4b85bd22 Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Fri, 31 May 2024 15:42:58 +0200 Subject: [PATCH 04/18] [Changed] way of manager-classification in tpl --- Application/Controller/Admin/GA4AdminUserInterface_main.php | 2 ++ Application/views/admin/tpl/d3googleanalytics4_main.tpl | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Application/Controller/Admin/GA4AdminUserInterface_main.php b/Application/Controller/Admin/GA4AdminUserInterface_main.php index d8ae94f..b0e6a46 100644 --- a/Application/Controller/Admin/GA4AdminUserInterface_main.php +++ b/Application/Controller/Admin/GA4AdminUserInterface_main.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace D3\GoogleAnalytics4\Application\Controller\Admin; use D3\GoogleAnalytics4\Application\Model\Constants; +use D3\GoogleAnalytics4\Application\Model\ManagerHandler; use D3\GoogleAnalytics4\Application\Model\ManagerTypes; use OxidEsales\Eshop\Core\Registry; use OxidEsales\Eshop\Core\ViewConfig; @@ -20,6 +21,7 @@ class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controlle $this->addTplParam('d3ViewObject', $this); $this->addTplParam('d3ViewConfObject', Registry::get(ViewConfig::class)); $this->addTplParam('d3ManagerTypeArray', oxNew(ManagerTypes::class)->getManagerList()); + $this->addTplParam('d3CurrentCMP', oxNew(ManagerHandler::class)->getCurrManager()); return $return; } diff --git a/Application/views/admin/tpl/d3googleanalytics4_main.tpl b/Application/views/admin/tpl/d3googleanalytics4_main.tpl index 6e141e8..33455a4 100644 --- a/Application/views/admin/tpl/d3googleanalytics4_main.tpl +++ b/Application/views/admin/tpl/d3googleanalytics4_main.tpl @@ -81,8 +81,8 @@ From e500814e7e2ee56a57f98c282f25fe1c4f72585e Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Fri, 31 May 2024 15:46:10 +0200 Subject: [PATCH 05/18] [Added] auto safe on first approach ga4 + cmp-mod --- Application/Model/ManagerHandler.php | 33 +++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/Application/Model/ManagerHandler.php b/Application/Model/ManagerHandler.php index c207359..e5b7c18 100644 --- a/Application/Model/ManagerHandler.php +++ b/Application/Model/ManagerHandler.php @@ -22,13 +22,30 @@ class ManagerHandler $aManagerList = $oManagerTypes->getManagerList(); - foreach ($aManagerList as $managerName){ - if ($oViewConfig->isModuleActive($managerName)){ - return $managerName; - } + if ($this->getModuleSettingExplicitManagerSelectValue()){ + return $this->getExplicitManager(); } - return $this->getExplicitManager(); + foreach ($aManagerList as $shopModuleId => $publicCMPName){ + if ($oViewConfig->isModuleActive($shopModuleId)){ + $this->d3SaveShopConfVar($shopModuleId); + return $shopModuleId; + } + } + } + + /** + * @param string $sParam + * @return void + */ + public function d3SaveShopConfVar(string $sParam){ + Registry::getConfig()->saveShopConfVar( + 'select', + Constants::OXID_MODULE_ID."_HAS_STD_MANAGER", + $sParam, + Registry::getConfig()->getShopId(), + Constants::OXID_MODULE_ID + ); } /** @@ -48,8 +65,12 @@ class ManagerHandler /** @var ManagerTypes $oManagerTypes */ $oManagerTypes = oxNew(ManagerTypes::class); - return $oManagerTypes->isManagerInList($sPotentialManagerName) + $sCMPName = $oManagerTypes->isManagerInList($sPotentialManagerName) ? $sPotentialManagerName : "NONE"; + + $this->d3SaveShopConfVar($sCMPName); + + return $sCMPName; } } \ No newline at end of file From 9a5e1506e875e8a4c9500bd7254d27de999d41ca Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Fri, 31 May 2024 15:47:54 +0200 Subject: [PATCH 06/18] [Changed] clear code and adjust Naming --- Application/Model/ManagerTypes.php | 15 +++++---------- Modules/Core/ViewConfig.php | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Application/Model/ManagerTypes.php b/Application/Model/ManagerTypes.php index 191c9c5..5db77ff 100644 --- a/Application/Model/ManagerTypes.php +++ b/Application/Model/ManagerTypes.php @@ -6,11 +6,8 @@ use D3\GoogleAnalytics4\Application\Model\CMP\Usercentrics; class ManagerTypes { - #ToDo: make own classes for each of the manager - - - const EXTERNAL_SERVICE = "externalService"; - const NET_COOKIE_MANAGER = "net_cookie_manager"; + const EXTERNAL_SERVICE = "eigener Service"; + const NET_COOKIE_MANAGER = "Netensio Cookie Manager"; /** * Further information's: @@ -20,11 +17,9 @@ class ManagerTypes const CONSENTMANAGER = "Consentmanager"; - const CONSENTMANAGER = "CONSENTMANAGER"; + const COOKIEFIRST = "Cookiefirst"; - const COOKIEFIRST = "COOKIEFIRST"; - - const COOKIEBOT = "COOKIEBOT"; + const COOKIEBOT = "Cookiebot"; /** * @return array @@ -49,6 +44,6 @@ class ManagerTypes */ public function isManagerInList(string $sManager) :bool { - return in_array($sManager, $this->getManagerList(), true); + return in_array($sManager, array_keys($this->getManagerList()), true); } } \ No newline at end of file diff --git a/Modules/Core/ViewConfig.php b/Modules/Core/ViewConfig.php index 3ff33db..152b0f2 100644 --- a/Modules/Core/ViewConfig.php +++ b/Modules/Core/ViewConfig.php @@ -79,7 +79,7 @@ class ViewConfig extends ViewConfig_parent } // No Cookie Manager in use - if (!$this->shallUseOwnCookieManager()) { + if (false === $this->shallUseOwnCookieManager()) { return true; } From 4b69a583c234476ff4ba5fd52b9b261c46025ecd Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Mon, 3 Jun 2024 11:42:39 +0200 Subject: [PATCH 07/18] [Bump] Metadata && Changelog --- CHANGELOG.md | 22 ++++++++++++++++++++++ metadata.php | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c03a3f..c035052 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,30 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [unreleased](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.2...rel_2.x) - 2024-x + +## [2.18.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.2...2.18.0) - 2024-06-03 ### Added - trait for generalized method +- new admin UI +- additional check for properly activated module +- admin headitem alternative +- usercentrips step/ option 2 +- group CMP-Functionalities/ properties into own Model +- additional help texts, translations, explanations +- extended docs +- auto safe on first approach ga4 + cmp-mod +## Changed +- declare module settings consistency +- configParamGetter +- clear dead code +- template code upgrade +- lang text +- amount of save-buttons +- Usercentrics-Class constants and adjust global-module-code to it +- CMP-output in tpl +- clear code and adjust Naming +## Fixed +- false class-property declaration ## [2.17.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.1...2.17.2) - 2024-04-11 ### Fixed diff --git a/metadata.php b/metadata.php index a6bef84..98c07e1 100755 --- a/metadata.php +++ b/metadata.php @@ -50,7 +50,7 @@ $aModule = [ Die Entwicklung basiert auf einem Fork von Marat Bedoev - Github-Link ", 'thumbnail' => 'thumbnail.png', - 'version' => 'Dev-2.18.0', + 'version' => '2.18.0', 'author' => 'Data Development (Inh.: Thomas Dartsch)', 'email' => 'support@shopmodule.com', 'url' => 'https://www.oxidmodule.com/', From cea8cc9163472b97f3d87a4ed9870d2a59ca9dce Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Mon, 3 Jun 2024 11:49:59 +0200 Subject: [PATCH 08/18] [Removed] false xml excludation --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index bb89769..1f56136 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,6 @@ "*.md", "composer.json", ".php-cs-fixer.php", - "*.xml", "*.neon" ], "target-directory": "d3/googleanalytics4" From 62ef191d47fa25d9912c242c876318462fbbcb70 Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Mon, 3 Jun 2024 11:51:08 +0200 Subject: [PATCH 09/18] [Added] extended changelog entries --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c035052..8cfefdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - clear code and adjust Naming ## Fixed - false class-property declaration +## Removed +- deprecated and obsolete module-settings +- false composer xml-excludation ## [2.17.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.1...2.17.2) - 2024-04-11 ### Fixed From 10386ccbf5a3eab8d1fcf08d1ca1f36856dfff12 Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Mon, 3 Jun 2024 12:02:44 +0200 Subject: [PATCH 10/18] [Added] onActivate/ onDeactivate --- Setup/Actions.php | 30 ++++++++++++++++++++++++++++++ Setup/Events.php | 37 +++++++++++++++++++++++++++++++++++++ metadata.php | 6 +++++- 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 Setup/Actions.php create mode 100644 Setup/Events.php diff --git a/Setup/Actions.php b/Setup/Actions.php new file mode 100644 index 0000000..ff577d6 --- /dev/null +++ b/Setup/Actions.php @@ -0,0 +1,30 @@ +saveShopConfVar( + $sVarType, + Constants::OXID_MODULE_ID.$sSettingName, + $sSettingValue, + $oConfig->getShopId(), + Constants::OXID_MODULE_ID + ); + } +} \ No newline at end of file diff --git a/Setup/Events.php b/Setup/Events.php new file mode 100644 index 0000000..aa0d67e --- /dev/null +++ b/Setup/Events.php @@ -0,0 +1,37 @@ +d3SaveDefaultSettings( + 'str', + '_sServersidetagging_js', + 'https://www.googletagmanager.com/gtm.js' + ); + $oActions->d3SaveDefaultSettings( + 'str', + '_sServersidetagging_js', + 'https://www.googletagmanager.com/ns.html' + ); + $oActions->d3SaveDefaultSettings( + 'str', + '_sContainerID', + 'GTM-' + ); + } + + /** + * @return void + */ + public static function onDeactivate(){} +} \ No newline at end of file diff --git a/metadata.php b/metadata.php index 98c07e1..447e519 100755 --- a/metadata.php +++ b/metadata.php @@ -175,5 +175,9 @@ $aModule = [ 'file' => '/Application/views/blocks/remove_from_cart.tpl', 'position' => 150 ] - ] + ], + 'events' => [ + 'onActivate' => '\D3\GoogleAnalytics4\Setup\Events::onActivate', + 'onDeactivate' => '\D3\GoogleAnalytics4\Setup\Events::onDeactivate', + ], ]; \ No newline at end of file From efac71905eadd99c2111bc10db410f2e8d8802f7 Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Mon, 3 Jun 2024 12:03:03 +0200 Subject: [PATCH 11/18] [Bump] Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cfefdb..dbd6cf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - additional help texts, translations, explanations - extended docs - auto safe on first approach ga4 + cmp-mod +- onActivate/ onDeactivate ## Changed - declare module settings consistency - configParamGetter From 1dc65ad24af022c85444f3280d395d285f309074 Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Mon, 3 Jun 2024 12:15:00 +0200 Subject: [PATCH 12/18] [Fixed] wrong to-save param --- Setup/Events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Setup/Events.php b/Setup/Events.php index aa0d67e..30ac24e 100644 --- a/Setup/Events.php +++ b/Setup/Events.php @@ -20,7 +20,7 @@ class Events ); $oActions->d3SaveDefaultSettings( 'str', - '_sServersidetagging_js', + '_sServersidetagging_nojs', 'https://www.googletagmanager.com/ns.html' ); $oActions->d3SaveDefaultSettings( From 592ea4284c23bb27730b5cc8df0f399cc99197b9 Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Mon, 3 Jun 2024 12:15:32 +0200 Subject: [PATCH 13/18] [Bump] Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbd6cf0..c492771 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - clear code and adjust Naming ## Fixed - false class-property declaration +- wrong to-save param ## Removed - deprecated and obsolete module-settings - false composer xml-excludation From b7167ec60a13288ec7428f6aaaeb3dc70e523530 Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Tue, 4 Jun 2024 12:09:29 +0200 Subject: [PATCH 14/18] [Fixed] missing return statements, on null --- Application/Model/ManagerHandler.php | 4 +++- Modules/Core/ViewConfig.php | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Application/Model/ManagerHandler.php b/Application/Model/ManagerHandler.php index e5b7c18..3bb71ca 100644 --- a/Application/Model/ManagerHandler.php +++ b/Application/Model/ManagerHandler.php @@ -32,6 +32,8 @@ class ManagerHandler return $shopModuleId; } } + + return ""; } /** @@ -53,7 +55,7 @@ class ManagerHandler */ public function getModuleSettingExplicitManagerSelectValue() :string { - return Registry::get(ViewConfig::class)->d3GetModuleConfigParam('_HAS_STD_MANAGER'); + return Registry::get(ViewConfig::class)->d3GetModuleConfigParam('_HAS_STD_MANAGER')?:""; } /** diff --git a/Modules/Core/ViewConfig.php b/Modules/Core/ViewConfig.php index 152b0f2..ac7b754 100644 --- a/Modules/Core/ViewConfig.php +++ b/Modules/Core/ViewConfig.php @@ -173,7 +173,7 @@ class ViewConfig extends ViewConfig_parent public function isGtmConsentModeSetActivated() :bool { - return $this->d3GetModuleConfigParam("_blEnableConsentMode"); + return $this->d3GetModuleConfigParam("_blEnableConsentMode")?: false; } public function getGtmDataLayer() @@ -215,7 +215,7 @@ class ViewConfig extends ViewConfig_parent public function isDebugModeOn() :bool { - return $this->d3GetModuleConfigParam("_blEnableDebug"); + return $this->d3GetModuleConfigParam("_blEnableDebug")?: false; } /** @@ -225,7 +225,7 @@ class ViewConfig extends ViewConfig_parent */ public function getServerSidetaggingJsDomain() :string { - return $this->d3GetModuleConfigParam("_sServersidetagging_js"); + return $this->d3GetModuleConfigParam("_sServersidetagging_js")?: ""; } /** @@ -235,7 +235,7 @@ class ViewConfig extends ViewConfig_parent */ public function getServerSidetaggingNoJsDomain() :string { - return $this->d3GetModuleConfigParam('_sServersidetagging_nojs'); + return $this->d3GetModuleConfigParam('_sServersidetagging_nojs')?: ""; } /** From 97dad5c8eb09b71edaaa4b88ada2c8b57349eca1 Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Tue, 4 Jun 2024 12:10:47 +0200 Subject: [PATCH 15/18] [Bump] Metadata && Changelog --- CHANGELOG.md | 4 ++++ metadata.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c492771..c05bde5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.2...rel_2.x) - 2024-x +## [2.18.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.18.0...2.18.1) - 2024-06-04 +### Fixed +- missing return statement, on null/ none + ## [2.18.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.2...2.18.0) - 2024-06-03 ### Added - trait for generalized method diff --git a/metadata.php b/metadata.php index 447e519..d95a66a 100755 --- a/metadata.php +++ b/metadata.php @@ -50,7 +50,7 @@ $aModule = [ Die Entwicklung basiert auf einem Fork von Marat Bedoev - Github-Link ", 'thumbnail' => 'thumbnail.png', - 'version' => '2.18.0', + 'version' => '2.18.1', 'author' => 'Data Development (Inh.: Thomas Dartsch)', 'email' => 'support@shopmodule.com', 'url' => 'https://www.oxidmodule.com/', From cc2e9a5fc6dd5bac9c644f93ea93aebf504b0ff1 Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Mon, 24 Jun 2024 16:08:36 +0200 Subject: [PATCH 16/18] [Fixed] overwriting existing settings accidentally the existing settings were overwritten --- Setup/Actions.php | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/Setup/Actions.php b/Setup/Actions.php index ff577d6..25a6e45 100644 --- a/Setup/Actions.php +++ b/Setup/Actions.php @@ -7,6 +7,7 @@ namespace D3\GoogleAnalytics4\Setup; use D3\GoogleAnalytics4\Application\Model\Constants; use OxidEsales\Eshop\Core\Registry; +use OxidEsales\Eshop\Core\ViewConfig; class Actions { @@ -19,12 +20,23 @@ class Actions public function d3SaveDefaultSettings(string $sVarType, string $sSettingName, string $sSettingValue){ $oConfig = Registry::getConfig(); - $oConfig->saveShopConfVar( - $sVarType, - Constants::OXID_MODULE_ID.$sSettingName, - $sSettingValue, - $oConfig->getShopId(), - Constants::OXID_MODULE_ID - ); + if (false === ($this->d3GetModuleConfigParam($sSettingName) === $sSettingValue)){ + $oConfig->saveShopConfVar( + $sVarType, + Constants::OXID_MODULE_ID.$sSettingName, + $sSettingValue, + $oConfig->getShopId(), + Constants::OXID_MODULE_ID + ); + } + } + + /** + * @param string $configParamName + * @return mixed + */ + public function d3GetModuleConfigParam(string $configParamName) + { + return Registry::get(ViewConfig::class)->d3GetModuleConfigParam($configParamName); } } \ No newline at end of file From 16387c59bb1bb1243ca4d82cf3d6a300840d2541 Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Mon, 24 Jun 2024 16:08:36 +0200 Subject: [PATCH 17/18] [Fixed] overwriting existing settings accidentally the existing settings were overwritten --- Setup/Actions.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Setup/Actions.php b/Setup/Actions.php index ff577d6..8d37da3 100644 --- a/Setup/Actions.php +++ b/Setup/Actions.php @@ -7,6 +7,7 @@ namespace D3\GoogleAnalytics4\Setup; use D3\GoogleAnalytics4\Application\Model\Constants; use OxidEsales\Eshop\Core\Registry; +use OxidEsales\Eshop\Core\ViewConfig; class Actions { @@ -19,6 +20,10 @@ class Actions public function d3SaveDefaultSettings(string $sVarType, string $sSettingName, string $sSettingValue){ $oConfig = Registry::getConfig(); + if (trim($this->d3GetModuleConfigParam($sSettingName)) !== trim($sSettingValue)){ + $sSettingValue = trim($this->d3GetModuleConfigParam($sSettingName)); + } + $oConfig->saveShopConfVar( $sVarType, Constants::OXID_MODULE_ID.$sSettingName, @@ -27,4 +32,13 @@ class Actions Constants::OXID_MODULE_ID ); } + + /** + * @param string $configParamName + * @return mixed + */ + public function d3GetModuleConfigParam(string $configParamName) + { + return Registry::get(ViewConfig::class)->d3GetModuleConfigParam($configParamName); + } } \ No newline at end of file From 81c7051f7be7a0dc82d6a77bfd9c9fa98d4d68ad Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Tue, 25 Jun 2024 11:22:18 +0200 Subject: [PATCH 18/18] [Bump] Metadata && Changelog --- CHANGELOG.md | 4 ++++ metadata.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c05bde5..5710810 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.2...rel_2.x) - 2024-x +## [2.18.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.18.0...2.18.1) - 2024-06-25 +### Fixed +- oe-console apply-configuration triggers on-activate and overwrites existing values + ## [2.18.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.18.0...2.18.1) - 2024-06-04 ### Fixed - missing return statement, on null/ none diff --git a/metadata.php b/metadata.php index d95a66a..9addf64 100755 --- a/metadata.php +++ b/metadata.php @@ -50,7 +50,7 @@ $aModule = [ Die Entwicklung basiert auf einem Fork von Marat Bedoev - Github-Link ", 'thumbnail' => 'thumbnail.png', - 'version' => '2.18.1', + 'version' => '2.18.2', 'author' => 'Data Development (Inh.: Thomas Dartsch)', 'email' => 'support@shopmodule.com', 'url' => 'https://www.oxidmodule.com/',