Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions Classes/Form/TagListElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,18 @@
*/

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;

/**
* Render a list of tags.
*/
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
Expand Down
14 changes: 0 additions & 14 deletions Classes/TcaHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down