Search code examples
phptypo3fluidtypo3-9.xflexform

Flexform not working in TYPO3 9.5, not able to fix it myself


I'm working with FCE Extensions for TYPO3, to create simple Contentelements. They are working fine in TYPO3 v8 but when I install them at TYPO3 9.5 my FlexForms are not working anymore. I'm not able to find the Problem, hopefully someone here can help me out. Maybe something changed and I didn't notice it?

As the complete extension is working and everything looks fine, there must be some kind of problem at the ext_tables.php, so I will copy mine here.

The TCA Call is workin, when I add e.g "header" to the list it's showing directly. So the pluginSignature is fine too. I also tried adding $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; this is also not helping me out.

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

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
    $_EXTKEY,
    'Content',
    'Contactbar'
);


$pluginSignature = str_replace('_', '', $_EXTKEY) . '_content';
$TCA['tt_content']['types'][$pluginSignature]['showitem'] = '
--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general, pi_flexform, 
--div--;Style, --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.frames;frames,
--div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, hidden, starttime, endtime,tx_gridelements_container, tx_gridelements_columns';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
        $pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform_contactbar.xml', '*');

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/Configuration/TSconfig/Content.ts">');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'contactbar');

Solution

  • I've managed to fix it myself. If someone got the same error, the solution is pretty simple. Move your tt_content declarations to /Configuration/TCA/Overrides/tt_content.php

    So you have ext_tables like this:

    <?php
    if (!defined('TYPO3_MODE')) {
        die('Access denied.');
    }
    
    \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
        $_EXTKEY,
        'Content',
        'Contactbar'
    );
    
    
    $pluginSignature = str_replace('_', '', $_EXTKEY) . '_content';
    
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/Configuration/TSconfig/Content.ts">');
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'contactbar');
    

    And you have tt_content.php like this:

    <?php
    $tca = [
        'types' => [
            'contactbar_content' => [
                'showitem' => '--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general, pi_flexform,--div--;Style, --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.frames;frames,--div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, hidden, starttime, endtime,tx_gridelements_container, tx_gridelements_columns'
            ]
        ]
    ];
    $GLOBALS['TCA']['tt_content'] = array_replace_recursive($GLOBALS['TCA']['tt_content'], $tca);
    
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
        '*',
        'FILE:EXT:contactbar/Configuration/FlexForms/flexform_contactbar.xml',
        'contactbar_content'
    );