typo3typo3-11.x

TYPO3 FAL Image in section of a DCE


I'm in the process to migrate an old v7 TYPO3 installation to v11. But I struggle with a DCE content element which uses sections and within the section a relation to sys_file.

The old flexform code looks like this:

<config>
    <type>group</type>
    <internal_type>db</internal_type>
    <appearance>
        <elementBrowserType>file</elementBrowserType>
        <elementBrowserAllowed>gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai,svg</elementBrowserAllowed>
    </appearance>
    <allowed>sys_file</allowed>
    <size>1</size>
    <minitems>0</minitems>
    <maxitems>1</maxitems>
    <show_thumbs>1</show_thumbs>
</config>

When I try to migrate the flexform code to use FAL, I end up with this error message in the TYPO3 backend:

#1458745468 UnexpectedValueException
Invalid flex form data structure on field name "pi_flexform" with element "sliderImage" in section container "container_carousel": Nesting inline elements in flex form sections is not allowed.

The flexform I used is a preset from DCE:

<config>
    <type>inline</type>
    <foreign_table>sys_file_reference</foreign_table>
    <foreign_field>uid_foreign</foreign_field>
    <foreign_sortby>sorting_foreign</foreign_sortby>
    <foreign_table_field>tablenames</foreign_table_field>
    <foreign_match_fields>
        <fieldname>{$variable}</fieldname>
    </foreign_match_fields>
    <foreign_label>uid_local</foreign_label>
    <foreign_selector>uid_local</foreign_selector>
    <overrideChildTca>
        <columns>
            <uid_local>
                <config>
                    <appearance>
                        <elementBrowserType>file</elementBrowserType>
                        <elementBrowserAllowed>gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai,svg</elementBrowserAllowed>
                    </appearance>
                </config>
            </uid_local>
        </columns>
        <types type="array">
            <numIndex index="2">
                <showitem>--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette</showitem>
            </numIndex>
        </types>
    </overrideChildTca>

    <minitems>0</minitems>
    <maxitems>99</maxitems>

    <appearance>
        <useSortable>1</useSortable>
        <headerThumbnail>
            <field>uid_local</field>
            <width>45c</width>
            <height>45</height>
        </headerThumbnail>

        <enabledControls>
            <info>1</info>
            <dragdrop>1</dragdrop>
            <hide>1</hide>
            <new>0</new>
            <sort>0</sort>
            <delete>1</delete>
        </enabledControls>

        <createNewRelationLinkTitle>LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference</createNewRelationLinkTitle>
    </appearance>

    <behaviour>
        <allowLanguageSynchronization>1</allowLanguageSynchronization>
    </behaviour>

    <dce_load_schema>1</dce_load_schema>
    <dce_get_fal_objects>1</dce_get_fal_objects>
</config>

Is it even possible to have a FAL relation within a section item of a DCE?

Or are there any other ideas how to solve my problem?


Solution

  • Is it even possible to have a FAL relation within a section item of a DCE?

    No. The problem seems to be having an ID for such relations.

    Or are there any other ideas how to solve my problem?

    For some (few) cases having multiple fields could be a solution. E.g. for an image-slider having fields "Pic1", "Text1", ..., "Pic5", "Text5".

    Or get rid of DCE and migrate to custom CEs ;-)