TYPO3 - TCA in ext_tables.php check and TCA/Overri

2019-03-06 00:27发布

问题:

Updated ext_tables.php, TCA and TCA/Overrides for TYPO3 8LTS? I moved the TCA definitions from ext_tables.php to /TCA folder and the query in list view is working again:

ext_tables.php

<?php
if (!defined('TYPO3_MODE')) {die('Access denied.');}

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
    $_EXTKEY,
    'Code',
    'Description'
);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_code_domain_model_code', 'EXT:code/Resources/Private/Language/locallang_csh_tx_code_domain_model_code.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_code_domain_model_code');

Configuration/TCA/tx_code_domain_model_code.php

... // TCA defintions

Configuration/TCA/Overrides/tt_content.php

<?php
if (!defined('TYPO3_MODE')) {die('Access denied.');}

$_EXTKEY = 'code';

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
    $_EXTKEY,
    'Code',
    'Description'
);

$extensionName = strtolower(\TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY)); 
$pluginName = strtolower('Code'); 
$pluginSignature = $extensionName.'_'.$pluginName; 
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; 
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:'.$_EXTKEY . '/Configuration/FlexForms/flexform_code.xml'); 

Configuration/TCA/Overrides/tt_content.php

<?php
if (!defined('TYPO3_MODE')) {die('Access denied.');}

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('code', 'Configuration/TypoScript', 'Description');

回答1:

It's not compatible.

You should do your TCA definition of tx_code_domain_model_code in: Configuration/TCA/tx_code_domain_model_code.php

The static template definition in: Configuration/TCA/Overrides/sys_template.php

And your plugin and flexform definition in: Configuration/TCA/Overrides/tt_content.php

Be aware that the $_EXTKEY variable is not defined in those files so you have to type the extension key yourself.