扩展构建器覆盖fe_user TCA

时间:2014-03-12 21:46:39

标签: typo3 extbase

如果我试图通过在Typo3 6.1.7中的扩展构建器上创建一个新的模型对象来扩展fe_user表,它会通过在我的扩展名的ext_tables.php中写下这些行来覆盖TCA:

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('fe_users', 'EXT:voiwizard/Resources/Private/Language/locallang_csh_fe_users.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('fe_users');
$TCA['fe_users'] = array(
    'ctrl' => array(
        'title' => 'LLL:EXT:voiwizard/Resources/Private/Language/locallang_db.xlf:fe_users',
        'label' => 'prova',
        'tstamp' => 'tstamp',
        'crdate' => 'crdate',
        'cruser_id' => 'cruser_id',
        'dividers2tabs' => TRUE,

        'versioningWS' => 2,
        'versioning_followPages' => TRUE,
        'origUid' => 't3_origuid',
        'languageField' => 'sys_language_uid',
        'transOrigPointerField' => 'l10n_parent',
        'transOrigDiffSourceField' => 'l10n_diffsource',
        'delete' => 'deleted',
        'enablecolumns' => array(
            'disabled' => 'hidden',
            'starttime' => 'starttime',
            'endtime' => 'endtime',
        ),
        'searchFields' => 'prova,',
        'dynamicConfigFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/TCA/User.php',
        'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/fe_users.gif'
    ),
);

此代码覆盖原始fe_users的TCA配置,后端[网站用户] [1]表变得无法访问。 有没有办法阻止这种情况,或者每次我想在扩展构建器中保存更改时是否必须删除这些行?

1 个答案:

答案 0 :(得分:4)

我在我的关系中发现错误:

为了在Extension Builder中使用模型对象正确扩展fe_users表,我不得不扩展现有的模型类" \ TYPO3 \ CMS \ Extbase \ Domain \ Model \ FrontendUser而不是"映射到现有表" fe_users。

enter image description here

通过这种方式,一切都按预期工作!