Project

General

Profile

Actions

Bug #101962

open

New records created on a field of type INLINE have the wrong sys_language_uid value

Added by Philipp Wrann about 1 year ago. Updated 8 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Start date:
2024-03-14
Due date:
% Done:

0%

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

Description

When adding a field of type "inline" to a pi_flexform structure, a new created inline relation record does not have the language value of the parent record. When using the same config on a regular TCA field the new record will have the correct sys_language_uid (synced with the parent).

This is a variation (only names and labels changed) of the flexform:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
    <meta>
        <langDisable>1</langDisable>
    </meta>
    <sheets>
        <sDEF>
            <ROOT>
                <TCEforms>
                    <sheetTitle>Settings</sheetTitle>
                </TCEforms>
                <type>array</type>
                <el>
                    <records>
                        <TCEforms>
                            <label>Records</label>
                            <config>
                                <type>inline</type>
                                <foreign_table>tx_some_record</foreign_table>
                                <foreign_field>parent_uid</foreign_field>
                                <foreign_table_field>parent_table</foreign_table_field>
                                <foreign_match_fields>
                                    <role>some_role</role>
                                </foreign_match_fields>
                                <foreign_sortby>sorting</foreign_sortby>
                                <maxitems>3</maxitems>
                                <appearance>
                                    <collapseAll>0</collapseAll>
                                    <newRecordLinkTitle>Add new record</newRecordLinkTitle>
                                    <useSortable>1</useSortable>
                                </appearance>
                                <behaviour>
                                    <enableCascadingDelete>1</enableCascadingDelete>
                                </behaviour>
                                <overrideChildTca>
                                    <columns>
                                        <some_field>
                                            <config>
                                                <default>1</default>
                                            </config>
                                        </some_field>
                                    </columns>
                                </overrideChildTca>
                            </config>
                        </TCEforms>
                    </records>
                </el>
            </ROOT>
        </sDEF>
    </sheets>
</T3DataStructure>

This is the relevant part of the TCA for tx_some_record

<?php
return [
    'ctrl' => [
        'label' => 'text',
        'title' => 'Some record',
        'type' => 'type',
        'typeicon_classes' => [
            'default' => 'tx-some-record',
        ],
        'rootLevel' => 0,
        'hideTable' => true,
        'delete' => 'deleted',
        'enablecolumns' => [
            'disabled' => 'hidden',
        ],
        'sortby' => 'sorting',
        'tstamp' => 'tstamp',
        'crdate' => 'crdate',
        'cruser_id' => 'cruser_id',
        'transOrigPointerField' => 'l18n_parent',
        'transOrigDiffSourceField' => 'l18n_diffsource',
        'languageField' => 'sys_language_uid',
        'translationSource' => 'l10n_source',
    ],
    'interface' => [
        'maxDBListItems' => 30,
        'maxSingleDBListItems' => 50,
    ],
    'columns' => [
        'sys_language_uid' => [
            'exclude' => true,
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
            'config' => [
                'type' => 'language',
            ],
        ],
        'l18n_parent' => [
            'displayCond' => 'FIELD:sys_language_uid:>:0',
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectSingle',
                'items' => [
                    [
                        '',
                        0
                    ]
                ],
                'foreign_table' => 'tx_some_record',
                'foreign_table_where' => 'AND tx_some_record.pid=###CURRENT_PID### AND tx_some_record.sys_language_uid IN (-1,0)',
                'default' => 0
            ],
        ],
        'l10n_source' => [
            'config' => [
                'type' => 'passthrough'
            ],
        ],
        'l18n_diffsource' => [
            'config' => [
                'type' => 'passthrough',
                'default' => ''
            ],
        ],
        'type' => [
            'config' => [
                'type' => 'user',
                'renderType' => 'hidden',
                'default' => '0',
            ],
        ],
        // other fields
    ],
    'types' => [
        // ...
    ],
    'palettes' => [
        // ...
    ],
];


Files

TcaFlexProcess.php (39.7 KB) TcaFlexProcess.php Kai Strecker, 2024-03-08 09:13
DataHandler.php (486 KB) DataHandler.php Kai Strecker, 2024-03-08 09:13

Related issues 3 (2 open1 closed)

Related to TYPO3 Core - Bug #76048: IRRE: Child records - New record doesn't get language of parent (non localized records but using new button)ClosedJo Hasenau2016-05-04

Actions
Related to TYPO3 Core - Story #101560: FlexForm related translation issuesNew2023-08-03

Actions
Related to TYPO3 Core - Bug #103393: New IRRE (inline) records created within FlexForm have the wrong sys_language_uid valueUnder Review2024-03-14

Actions
Actions

Also available in: Atom PDF