|
3 | 3 | defined('TYPO3') or die(); |
4 | 4 |
|
5 | 5 | (function () { |
6 | | - $childTcaTypes = [ |
7 | | - 0 => [ |
8 | | - 'showitem' => ' |
9 | | - --palette--;;basicoverlayPalette, |
10 | | - --palette--;;filePalette', |
11 | | - ], |
12 | | - (enum_exists(\TYPO3\CMS\Core\Resource\FileType::class) ? \TYPO3\CMS\Core\Resource\FileType::TEXT->value : \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT) => [ |
13 | | - 'showitem' => ' |
14 | | - --palette--;;imageoverlayPalette, |
15 | | - --palette--;;filePalette', |
16 | | - ], |
17 | | - (enum_exists(\TYPO3\CMS\Core\Resource\FileType::class) ? \TYPO3\CMS\Core\Resource\FileType::IMAGE->value : \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE) => [ |
18 | | - 'showitem' => ' |
19 | | - --palette--;;imageoverlayPalette, |
20 | | - --palette--;;filePalette', |
21 | | - ], |
22 | | - (enum_exists(\TYPO3\CMS\Core\Resource\FileType::class) ? \TYPO3\CMS\Core\Resource\FileType::AUDIO->value : \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO) => [ |
23 | | - 'showitem' => ' |
24 | | - --palette--;;audioOverlayPalette, |
25 | | - --palette--;;filePalette', |
26 | | - ], |
27 | | - (enum_exists(\TYPO3\CMS\Core\Resource\FileType::class) ? \TYPO3\CMS\Core\Resource\FileType::VIDEO->value : \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO) => [ |
28 | | - 'showitem' => ' |
29 | | - --palette--;;videoOverlayPalette, |
30 | | - --palette--;;filePalette', |
31 | | - ], |
32 | | - (enum_exists(\TYPO3\CMS\Core\Resource\FileType::class) ? \TYPO3\CMS\Core\Resource\FileType::APPLICATION->value : \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION) => [ |
33 | | - 'showitem' => ' |
34 | | - --palette--;;basicoverlayPalette, |
35 | | - --palette--;;filePalette', |
36 | | - ], |
37 | | - ]; |
38 | | - if ((\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Information\Typo3Version::class))->getMajorVersion() < 12) { |
39 | | - $GLOBALS['TCA']['tx_listelements_item']['ctrl']['cruser_id'] = 'cruser_id'; |
40 | | - $GLOBALS['TCA']['tx_listelements_item']['columns']['l10n_parent']['config']['internal_type'] = 'db'; |
41 | | - $GLOBALS['TCA']['tx_listelements_item']['columns']['sorting_foreign']['config']['type'] = 'input'; |
42 | | - $GLOBALS['TCA']['tx_listelements_item']['columns']['sorting_foreign']['config']['eval'] = 'int'; |
43 | | - $GLOBALS['TCA']['tx_listelements_item']['columns']['sorting_foreign']['config']['internal_type'] = 'db'; |
44 | | - $GLOBALS['TCA']['tx_listelements_item']['columns']['images']['config'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( |
45 | | - 'images', |
46 | | - [ |
47 | | - 'appearance' => [ |
48 | | - 'createNewRelationLinkTitle' => 'LLL:EXT:listelements/Resources/Private/Language/locallang_db.xlf:tx_listelements_item.images.addFileReference', |
49 | | - ], |
50 | | - // custom configuration for displaying fields in the overlay/reference table |
51 | | - // to use the imageoverlayPalette instead of the basicoverlayPalette |
52 | | - 'overrideChildTca' => [ |
53 | | - 'types' => $childTcaTypes, |
54 | | - ], |
55 | | - ] |
56 | | - ); |
57 | | - $GLOBALS['TCA']['tx_listelements_item']['columns']['assets']['config'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( |
58 | | - 'assets', |
59 | | - [ |
60 | | - 'appearance' => [ |
61 | | - 'createNewRelationLinkTitle' => 'LLL:EXT:listelements/Resources/Private/Language/locallang_db.xlf:tx_listelements_item.assets.addFileReference', |
62 | | - ], |
63 | | - // custom configuration for displaying fields in the overlay/reference table |
64 | | - // to use the imageoverlayPalette instead of the basicoverlayPalette |
65 | | - 'overrideChildTca' => [ |
66 | | - 'types' => $childTcaTypes, |
67 | | - ], |
68 | | - ] |
69 | | - ); |
70 | | - $GLOBALS['TCA']['tx_listelements_item']['columns']['link']['config'] = [ |
71 | | - 'type' => 'input', |
72 | | - 'renderType' => 'inputLink', |
73 | | - 'size' => 50, |
74 | | - 'max' => 1024, |
75 | | - 'eval' => 'trim', |
76 | | - 'fieldControl' => [ |
77 | | - 'linkPopup' => [ |
78 | | - 'options' => [ |
79 | | - 'title' => 'LLL:EXT:listelements/Resources/Private/Language/locallang_db.xlf:tx_listelements_item.link', |
80 | | - ], |
81 | | - ], |
82 | | - ], |
83 | | - 'softref' => 'typolink', |
84 | | - ]; |
| 6 | + $majorVersion = (new \TYPO3\CMS\Core\Information\Typo3Version())->getMajorVersion(); |
| 7 | + if ($majorVersion < 14) { |
| 8 | + $GLOBALS['TCA']['tx_listelements_item']['ctrl']['searchFields'] = 'header,subheader,bodytext,link'; |
85 | 9 | } else { |
86 | | - $GLOBALS['TCA']['tx_listelements_item']['columns']['assets']['config']['overrideChildTca']['types'] = $childTcaTypes; |
87 | | - $GLOBALS['TCA']['tx_listelements_item']['columns']['images']['config']['overrideChildTca']['types'] = $childTcaTypes; |
| 10 | + // https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/14.0/Breaking-106972-TCAControlOptionSearchFieldsRemoved.html |
| 11 | + // the Schema API detects searchable fields (e.g. all type text or input |
| 12 | + // we exclude: |
| 13 | + $GLOBALS['TCA']['tx_listelements_item']['columns']['tablename']['config']['searchable'] = false; |
| 14 | + $GLOBALS['TCA']['tx_listelements_item']['columns']['fieldname']['config']['searchable'] = false; |
88 | 15 | } |
89 | 16 | })(); |
0 commit comments