Project

General

Profile

Actions

Bug #103885

open

foreign_match_fields is ignored in flexforms in Typo3 12

Added by Georgi Mateev 6 months ago. Updated 8 days ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
System/Bootstrap/Configuration
Target version:
-
Start date:
2024-05-23
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

The inline TCA type (also tested for the new file type) does not respect the configuration foreign_match_fields.fieldname when in Flexform context. Up to TYPO3 v11 it would respect it and store the value in the sys_file_reference table. After updating to TYPO3 v12 it does not respect it anymore and writes the name of the TCA Field instead.

Example:

<settings.thumbnailImages>
                        <label>LLL:EXT:sg_vimeo/Resources/Private/Language/locallang.xlf:flexform.thumbnailImages
                        </label>
                        <description>
                            LLL:EXT:sg_vimeo/Resources/Private/Language/locallang.xlf:flexform.thumbnailImages.description
                        </description>
                        <config>
                            <type>inline</type>
                            <foreign_table>sys_file_reference</foreign_table>
                            <foreign_field>uid_foreign</foreign_field>
                            <foreign_table_field>tablenames</foreign_table_field>
                            <foreign_label>uid_local</foreign_label>
                            <foreign_sortby>sorting_foreign</foreign_sortby>
                            <foreign_selector>uid_local</foreign_selector>
                            <foreign_selector_fieldTcaOverride type="array">
                                <config>
                                    <appearance>
                                        <elementBrowserType>file</elementBrowserType>
                                        <elementBrowserAllowed>jpg,png,svg,jpeg,gif,webp</elementBrowserAllowed>
                                    </appearance>
                                </config>
                            </foreign_selector_fieldTcaOverride>
                            <foreign_match_fields type="array">
                                <fieldname>tx_sgvimeo_thumbnail_image</fieldname>
                            </foreign_match_fields>
                            <filter type="array">
                                <userFunc>TYPO3\CMS\Core\Resource\Filter\FileExtensionFilter->filterInlineChildren
                                </userFunc>
                                <parameters>
                                    <allowedFileExtensions>jpg,png,svg,jpeg,gif,webp</allowedFileExtensions>
                                    <disallowedFileExtensions></disallowedFileExtensions>
                                </parameters>
                            </filter>
                            <appearance type="array">
                                <useSortable>1</useSortable>
                                <headerThumbnail>
                                    <field>uid_local</field>
                                    <height>45m</height>
                                </headerThumbnail>
                                <enabledControls>
                                    <info>1</info>
                                    <new>0</new>
                                    <dragdrop>1</dragdrop>
                                    <sort>1</sort>
                                    <hide>1</hide>
                                    <delete>1</delete>
                                </enabledControls>
                            </appearance>
                            <overrideChildTca>
                                <columns type="array">
                                    <uid_local type="array">
                                        <config type="array">
                                            <appearance type="array">
                                                <elementBrowserType>file</elementBrowserType>
                                                <elementBrowserAllowed>jpg,png,svg,jpeg,gif</elementBrowserAllowed>
                                            </appearance>
                                        </config>
                                    </uid_local>
                                    <crop type="array">
                                        <config type="array">
                                            <cropVariants type="array">
                                                <medium type="array">
                                                    <disabled>1</disabled>
                                                </medium>
                                                <small type="array">
                                                    <disabled>1</disabled>
                                                </small>
                                                <extrasmall type="array">
                                                    <disabled>1</disabled>
                                                </extrasmall>
                                            </cropVariants>
                                        </config>
                                    </crop>
                                </columns>
                                <types type="array">
                                    <numIndex index="2">
                                        <showitem>
                                            --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette
                                        </showitem>
                                    </numIndex>
                                </types>
                            </overrideChildTca>
                        </config>
                    </settings.thumbnailImages>

Expected result in the database:
tx_sgvimeo_thumbnail_image

Actual result in the database:
settings.thumbnailImages

You can test this with our sgalinski/sg-vimeo extension in version 7.1.11 when trying to set a custom thumbnail image.

This looks like a bug in TYPO3 12 or an undocumented breaking change.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #99756: Move TcaMigration to FlexFormProcessorClosed2023-01-30

Actions
Actions #1

Updated by Christian Kuhn 6 months ago

  • Related to Bug #99756: Move TcaMigration to FlexFormProcessor added
Actions #2

Updated by Georg Ringer 4 months ago ยท Edited

  • Status changed from New to Accepted

problem is in \TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::migrateFlexField calls $this->tcaMigration->migrate which removes with unset $fieldConfig['config']['foreign_match_fields'] and in \TYPO3\CMS\Core\Configuration\Tca\TcaPreparation::configureFileReferences it is set by default to the fieldname

can be reproduced in v13 in tx_styleguide_flex with

'flex_4' => [
            'label' => 'flex_4',
            'config' => [
                'type' => 'flex',
                'ds' => [
                    'default' => '
                        <T3DataStructure>
                            <sheets>
                                <sInline>
                                    <ROOT>
                                        <sheetTitle>inline</sheetTitle>
                                        <type>array</type>
                                        <el>
                                          <settings.thumbnailImages>
                        <label>xxxx</label>
                        <description>
                            LLL:EXT:sg_vimeo/Resources/Private/Language/locallang.xlf:flexform.thumbnailImages.description
                        </description>
                        <config>
                            <type>inline</type>
                            <foreign_table>sys_file_reference</foreign_table>
                            <foreign_field>uid_foreign</foreign_field>
                            <foreign_table_field>tablenames</foreign_table_field>
                            <foreign_label>uid_local</foreign_label>
                            <foreign_sortby>sorting_foreign</foreign_sortby>
                            <foreign_selector>uid_local</foreign_selector>
                            <foreign_selector_fieldTcaOverride type="array">
                                <config>
                                    <appearance>
                                        <elementBrowserType>file</elementBrowserType>
                                        <elementBrowserAllowed>jpg,png,svg,jpeg,gif,webp</elementBrowserAllowed>
                                    </appearance>
                                </config>
                            </foreign_selector_fieldTcaOverride>
                            <foreign_match_fields type="array">
                                <fieldname>tx_sgvimeo_thumbnail_image</fieldname>
                            </foreign_match_fields>
                            <filter type="array">
                                <userFunc>TYPO3\CMS\Core\Resource\Filter\FileExtensionFilter->filterInlineChildren
                                </userFunc>
                                <parameters>
                                    <allowedFileExtensions>jpg,png,svg,jpeg,gif,webp</allowedFileExtensions>
                                    <disallowedFileExtensions></disallowedFileExtensions>
                                </parameters>
                            </filter>
                            <appearance type="array">
                                <useSortable>1</useSortable>
                                <headerThumbnail>
                                    <field>uid_local</field>
                                    <height>45m</height>
                                </headerThumbnail>
                                <enabledControls>
                                    <info>1</info>
                                    <new>0</new>
                                    <dragdrop>1</dragdrop>
                                    <sort>1</sort>
                                    <hide>1</hide>
                                    <delete>1</delete>
                                </enabledControls>
                            </appearance>
                            <overrideChildTca>
                                <columns type="array">
                                    <uid_local type="array">
                                        <config type="array">
                                            <appearance type="array">
                                                <elementBrowserType>file</elementBrowserType>
                                                <elementBrowserAllowed>jpg,png,svg,jpeg,gif</elementBrowserAllowed>
                                            </appearance>
                                        </config>
                                    </uid_local>

                                </columns>

                            </overrideChildTca>
                        </config>
                    </settings.thumbnailImages>
                                        </el>
                                    </ROOT>
                                </sInline>

                            </sheets>
                        </T3DataStructure>
                    ',
                ],
            ],
        ],
Actions #3

Updated by Garvin Hicking 4 months ago

  • Category set to System/Bootstrap/Configuration
Actions #4

Updated by Lorenz Ulrich 8 days ago

@Georg Ringer As you also seem to have this problem, do you know what the way forward would be here?

Actions

Also available in: Atom PDF