Skip to content

Commit 5c05568

Browse files
authored
[TASK] Fix select item deprecation for TYPO3 12+
1 parent 7f059f2 commit 5c05568

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Configuration/TCA/Overrides/tt_content.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,24 @@
33
defined('TYPO3') or die();
44

55
call_user_func(static function () {
6+
7+
if ((\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Information\Typo3Version::class))->getMajorVersion() < 12) {
8+
$CTypeSelectItem = [
9+
'LLL:EXT:codeblock/Resources/Private/Language/locallang_db.xlf:tt_content.CType',
10+
'codeblock',
11+
'content-codeblock'
12+
];
13+
} else {
14+
$CTypeSelectItem = [
15+
'label' => 'LLL:EXT:codeblock/Resources/Private/Language/locallang_db.xlf:tt_content.CType',
16+
'value' => 'codeblock',
17+
'icon' => 'content-codeblock'
18+
];
19+
}
620
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
721
'tt_content',
822
'CType',
9-
['LLL:EXT:codeblock/Resources/Private/Language/locallang_db.xlf:tt_content.CType', 'codeblock', 'content-codeblock'],
23+
$CTypeSelectItem,
1024
'html',
1125
'after'
1226
);

0 commit comments

Comments
 (0)