From 356360443bb09499bf2c80a73f51a7bc0d3e9a09 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 6 May 2023 12:50:56 +0200 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=92=A5=20Drop=20support=20for=20TYPO3?= =?UTF-8?q?=20v10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TYPO3 v10 is no longer officially supported and I do not want to invest any time in testing the extension on it. Refs: #2 --- composer.json | 4 ++-- ext_emconf.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 656fbed..5940e38 100644 --- a/composer.json +++ b/composer.json @@ -22,8 +22,8 @@ } }, "require": { - "php": "7.2.0 - 8.1.99", - "typo3/cms-core": "^10.4 || ^11.5" + "php": "7.4.0 - 8.2.99", + "typo3/cms-core": "^11.5" }, "replace": { "typo3-ter/plausible-analytics": "self.version" diff --git a/ext_emconf.php b/ext_emconf.php index 811bc10..e8226fa 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -11,8 +11,8 @@ $EM_CONF[$_EXTKEY] = [ 'version' => '1.2.0', 'constraints' => [ 'depends' => [ - 'typo3' => '10.4.0-11.5.99', - 'php' => '7.2.0-8.1.99' + 'typo3' => '11.5.0-11.5.99', + 'php' => '7.4.0-8.2.99' ], ], 'autoload' => [ From 2af99f3a4dfd831c0f71352dd5540c8587b7fb8a Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 6 May 2023 12:53:11 +0200 Subject: [PATCH 2/5] =?UTF-8?q?=E2=AC=86=20Upgrade=20dependencies=20to=20i?= =?UTF-8?q?nclude=20TYPO3=20v12.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: #2 --- composer.json | 2 +- ext_emconf.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 5940e38..80dfc9e 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ }, "require": { "php": "7.4.0 - 8.2.99", - "typo3/cms-core": "^11.5" + "typo3/cms-core": "^11.5 || ^12.4" }, "replace": { "typo3-ter/plausible-analytics": "self.version" diff --git a/ext_emconf.php b/ext_emconf.php index e8226fa..580dd59 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -11,7 +11,7 @@ $EM_CONF[$_EXTKEY] = [ 'version' => '1.2.0', 'constraints' => [ 'depends' => [ - 'typo3' => '11.5.0-11.5.99', + 'typo3' => '11.5.0-12.4.99', 'php' => '7.4.0-8.2.99' ], ], From 89ee94bf28ddd9076de95ffb71fae3bf60dc2d1a Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 6 May 2023 12:54:55 +0200 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=90=9B=20Replace=20check=20for=20'TYP?= =?UTF-8?q?O3=5FMODE'=20with=20check=20for=20'TYPO3'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The TYPO3_MODE variable was deprecated with TYPO3 v11 and replaced with the TYPO3 constant. Refs: #2 --- ext_localconf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext_localconf.php b/ext_localconf.php index da336e7..d97af22 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,6 +1,6 @@ Date: Sat, 6 May 2023 12:55:57 +0200 Subject: [PATCH 4/5] =?UTF-8?q?=E2=9C=A8=20Use=20Context=20API=20to=20chec?= =?UTF-8?q?k=20for=20logged=20in=20backend=20user?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `isBackendUserLoggedIn()` function of the TSFE array is deprecated starting with TYPO3 v12 and since the Context API also provides the necssary aspect and functionality in v11 there is no harm in migrating now. Refs: #2 --- Classes/Hooks/PageRendererPreProcess.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Classes/Hooks/PageRendererPreProcess.php b/Classes/Hooks/PageRendererPreProcess.php index 02cf04d..8065b11 100644 --- a/Classes/Hooks/PageRendererPreProcess.php +++ b/Classes/Hooks/PageRendererPreProcess.php @@ -4,6 +4,7 @@ namespace MMK2410\PlausibleAnalytics\Hooks; use TYPO3\CMS\Core\Page\AssetCollector; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Core\Context\Context; class PageRendererPreProcess { @@ -13,22 +14,30 @@ class PageRendererPreProcess /** @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */ private $tsfe; + /** @var Context */ + private $context; + public function __construct(AssetCollector $assetCollector = null) { $this->assetCollector = $assetCollector ?? GeneralUtility::makeInstance(AssetCollector::class); $this->tsfe = $GLOBALS['TSFE'] ?? null; + $this->context = GeneralUtility::makeInstance(Context::class); } public function addLibrary(): void { - if (!isset($this->tsfe)) { + if (!isset($this->tsfe)|| !isset($this->context)) { return; } $domain = $this->getDomain(); $plausible = $this->getPlausibleURL(); - if (isset($domain) && isset($plausible) && !$this->tsfe->isBackendUserLoggedIn()) { + if ( + isset($domain) && + isset($plausible) && + !$this->context->getPropertyFromAspect('backend.user', 'isLoggedIn') + ) { $this->assetCollector->addJavaScript( 'plausible_analytics', $plausible . '/js/plausible.js', From cff6ac1849b48111b5a8f3cbdf7d407e06bc231f Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 6 May 2023 13:01:31 +0200 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=94=96=20Release=20preparations=20for?= =?UTF-8?q?=202.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 ++++++ ext_emconf.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64493d6..d364f4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2.0.0 - 2023-05-06 + +- 💥 Drop support for TYPO3 v10 (3563604) +- ⬆ Add support for TYPO3 v12 (2af99f3) +- ✨🐛 Resolve deprecations introduced with TYPO3 v11 and v12 (89ee94b, 8264969) + ## 1.2.0 - 2022-08-10 - [FEATURE] Add support for TYPO3 v11 and PHP 8.0 & 8.1 (25ccc28, 9c43bfc) diff --git a/ext_emconf.php b/ext_emconf.php index 580dd59..29ea66b 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -8,7 +8,7 @@ $EM_CONF[$_EXTKEY] = [ 'author_email' => 'opensource@mmk2410.org', 'state' => 'stable', 'clearCacheOnLoad' => true, - 'version' => '1.2.0', + 'version' => '2.0.0', 'constraints' => [ 'depends' => [ 'typo3' => '11.5.0-12.4.99',