mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-11-25 12:16:14 +01:00
[TASK] Make the TCA ready for TYPO3 v12 (#625)
Co-authored-by: lina.wolf <lwolf@w-commerce.de>
This commit is contained in:
parent
ee455e567b
commit
a6d75b72f3
2 changed files with 52 additions and 15 deletions
|
@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
- Make the TCA ready for TYPO3 v12 (#625)
|
||||||
- Upgrade to PHPUnit 9 and PHPCOV 8 (#610)
|
- Upgrade to PHPUnit 9 and PHPCOV 8 (#610)
|
||||||
- Convert functional test fixtures to CSV (#601)
|
- Convert functional test fixtures to CSV (#601)
|
||||||
- Use typed properties instead of `@var` annotations (#599, #612, #628)
|
- Use typed properties instead of `@var` annotations (#599, #612, #628)
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
$tca = [
|
||||||
'ctrl' => [
|
'ctrl' => [
|
||||||
'title' => 'LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_product_tea',
|
'title' => 'LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_product_tea',
|
||||||
'label' => 'title',
|
'label' => 'title',
|
||||||
'tstamp' => 'tstamp',
|
'tstamp' => 'tstamp',
|
||||||
'crdate' => 'crdate',
|
'crdate' => 'crdate',
|
||||||
'cruser_id' => 'cruser_id',
|
|
||||||
'delete' => 'deleted',
|
'delete' => 'deleted',
|
||||||
'default_sortby' => 'title',
|
'default_sortby' => 'title',
|
||||||
'iconfile' => 'EXT:tea/Resources/Public/Icons/Record.svg',
|
'iconfile' => 'EXT:tea/Resources/Public/Icons/Record.svg',
|
||||||
|
@ -22,7 +21,8 @@ return [
|
||||||
'type' => 'input',
|
'type' => 'input',
|
||||||
'size' => 40,
|
'size' => 40,
|
||||||
'max' => 255,
|
'max' => 255,
|
||||||
'eval' => 'trim,required',
|
'eval' => 'trim',
|
||||||
|
'required' => true,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'description' => [
|
'description' => [
|
||||||
|
@ -37,6 +37,41 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'image' => [
|
'image' => [
|
||||||
|
'label' => 'LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_product_tea.image',
|
||||||
|
'config' => [
|
||||||
|
'type' => 'file',
|
||||||
|
'maxitems' => 1,
|
||||||
|
'appearance' => [
|
||||||
|
'collapseAll' => true,
|
||||||
|
'useSortable' => false,
|
||||||
|
'enabledControls' => [
|
||||||
|
'hide' => false,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'allowed' => 'common-image-types',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
$typo3Version = new \TYPO3\CMS\Core\Information\Typo3Version();
|
||||||
|
if ($typo3Version->getMajorVersion() < 12) {
|
||||||
|
$tca = array_replace_recursive(
|
||||||
|
$tca,
|
||||||
|
[
|
||||||
|
'ctrl' => [
|
||||||
|
'cruser_id' => 'cruser_id',
|
||||||
|
],
|
||||||
|
'columns' => [
|
||||||
|
'title' => [
|
||||||
|
'config' => [
|
||||||
|
'eval' => 'trim,required',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
unset($tca['columns']['title']['required']);
|
||||||
|
$tca['columns']['image'] = [
|
||||||
'label' => 'LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_product_tea.image',
|
'label' => 'LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_product_tea.image',
|
||||||
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
|
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
|
||||||
'image',
|
'image',
|
||||||
|
@ -51,6 +86,7 @@ return [
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
],
|
];
|
||||||
],
|
}
|
||||||
];
|
|
||||||
|
return $tca;
|
||||||
|
|
Loading…
Reference in a new issue