Project

General

Profile

Actions

Bug #98104

open

FAL field in FlexForm creates a sys_file_reference db entry with wrong uid_foreign

Added by Nikita Hovratov almost 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2022-08-09
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Setup:

- At least one translation for the site
- A record / content element with a FAL field in FlexForm
- A page with such a record / content element + translated in connected mode

Reproduction steps:

- Add a new file reference in the default language
- Click save

Expected:

A new file reference item is visible

Actual:

Nothing is visually added after saving
Looking at the database, the sys_file_reference record has the uid_foreign value of the translated record.

What happens in DataHandler?

process_datamap: The datamap is populated with all localizations of the current record, but has only one sys_file_reference entry added for insertion.
processRemapStack: Later, when remapping the stack, the sys_file_reference record gets updated for every record (checkValue_inline_processDBdata). This leads to the uid_foreign field having the last uid of the datamap.

Example FlexForm:

<T3DataStructure>
    <meta type="array">
        <langDisable>1</langDisable>
    </meta>
    <sheets>
        <general>
            <ROOT type="array">
                <TCEforms>
                    <sheetTitle>Settings</sheetTitle>
                </TCEforms>
                <el type="array">
                    <image>
                        <TCEforms>
                            <label>Video</label>
                            <config>
                                <type>inline</type>
                                <maxitems>1</maxitems>
                                <foreign_table>sys_file_reference</foreign_table>
                                <foreign_table_field>tablenames</foreign_table_field>
                                <foreign_label>uid_local</foreign_label>
                                <foreign_sortby>sorting_foreign</foreign_sortby>
                                <foreign_field>uid_foreign</foreign_field>
                                <foreign_selector>uid_local</foreign_selector>
                                <foreign_match_fields>
                                    <fieldname>image</fieldname>
                                </foreign_match_fields>
                                <appearance type="array">
                                    <newRecordLinkAddTitle>1</newRecordLinkAddTitle>
                                    <headerThumbnail>
                                        <field>uid_local</field>
                                        <height>64</height>
                                        <width>64</width>
                                    </headerThumbnail>
                                    <enabledControls>
                                        <info>1</info>
                                        <new>0</new>
                                        <dragdrop>0</dragdrop>
                                        <sort>1</sort>
                                        <hide>0</hide>
                                        <delete>1</delete>
                                        <localize>1</localize>
                                    </enabledControls>
                                    <createNewRelationLinkTitle>LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference</createNewRelationLinkTitle>
                                </appearance>
                                <behaviour>
                                    <localizationMode>select</localizationMode>
                                    <localizeChildrenAtParentLocalization>1</localizeChildrenAtParentLocalization>
                                </behaviour>
                                <overrideChildTca>
                                    <columns type="array">
                                        <uid_local type="array">
                                            <config type="array">
                                                <appearance type="array">
                                                    <elementBrowserType>file</elementBrowserType>
                                                    <elementBrowserAllowed>jpg,png</elementBrowserAllowed>
                                                </appearance>
                                            </config>
                                        </uid_local>
                                    </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>
                        </TCEforms>
                    </image>
                </el>
            </ROOT>
        </general>
    </sheets>
</T3DataStructure>

No data to display

Actions

Also available in: Atom PDF