From bc68d96c17d705908085da4f406933d39325ac27 Mon Sep 17 00:00:00 2001 From: David Steeb Date: Mon, 30 Mar 2026 15:54:50 +0200 Subject: [PATCH] [TASK] Add TYPO3 v13/v14 support, drop v12 - Raise PHP requirement to ^8.2 (TYPO3 v13 minimum) - Update typo3/cms-core and typo3/cms-backend to ^13.0 || ^14.0 - Remove v12-specific MM_hasUidField conditional from TcaHelper - Remove Typo3Version dependency from TcaHelper (no longer needed) - Replace GeneralUtility::makeInstance() with constructor injection in TagListElement (UriBuilder); NodeFactory is set by the framework --- Classes/Form/TagListElement.php | 10 +--------- Classes/TcaHelper.php | 14 -------------- composer.json | 6 +++--- 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/Classes/Form/TagListElement.php b/Classes/Form/TagListElement.php index a31696f..2f641d7 100644 --- a/Classes/Form/TagListElement.php +++ b/Classes/Form/TagListElement.php @@ -13,11 +13,9 @@ */ use TYPO3\CMS\Backend\Form\Element\AbstractFormElement; -use TYPO3\CMS\Backend\Form\NodeFactory; use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\StringUtility; /** @@ -25,14 +23,8 @@ */ class TagListElement extends AbstractFormElement { - private UriBuilder $uriBuilder; - - // ToDo: when v12 is dropped add DI with only UriBuilder - public function __construct() + public function __construct(private readonly UriBuilder $uriBuilder) { - // ToDo: remove manual instances of properties when v12 is dropped - $this->uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); - $this->nodeFactory = GeneralUtility::makeInstance(NodeFactory::class); } public function render(): array diff --git a/Classes/TcaHelper.php b/Classes/TcaHelper.php index 6276969..aa59f3c 100644 --- a/Classes/TcaHelper.php +++ b/Classes/TcaHelper.php @@ -12,22 +12,12 @@ * of the License, or any later version. */ -use TYPO3\CMS\Core\Information\Typo3Version; -use TYPO3\CMS\Core\Utility\GeneralUtility; - /** * Helper functionality to quickly work with tags without having to configure TCA, this also allows for "tag" * to change implementation without having users to modify their code. */ class TcaHelper { - private Typo3Version $typo3Version; - - public function __construct() - { - $this->typo3Version = GeneralUtility::makeInstance(Typo3Version::class); - } - public function buildFieldConfiguration(string $table, string $fieldName, array $fieldConfigurationOverride = null): array { $fieldConfiguration = [ @@ -46,10 +36,6 @@ public function buildFieldConfiguration(string $table, string $fieldName, array ], ]; - if ($this->typo3Version->getMajorVersion() === 12) { - $fieldConfiguration['MM_hasUidField'] = true; - } - // Merge changes to TCA configuration if (!empty($fieldConfigurationOverride)) { $fieldConfiguration = array_replace_recursive( diff --git a/composer.json b/composer.json index d5bc55a..8ecdb3d 100644 --- a/composer.json +++ b/composer.json @@ -4,9 +4,9 @@ "description": "Manage tags in TYPO3 Core", "license": "GPL-2.0-or-later", "require": { - "php": "^7.4 || ^8.0", - "typo3/cms-core": "^12.0 || ^13.0", - "typo3/cms-backend": "^12.0 || ^13.0" + "php": "^8.2", + "typo3/cms-core": "^13.0 || ^14.0", + "typo3/cms-backend": "^13.0 || ^14.0" }, "extra": { "typo3/cms": {