Bug #88768

l10n_parent as group field breaks backend

Added by Markus Klein about 1 month ago. Updated about 1 month ago.

Status:
Under Review
Priority:
Must have
Assignee:
Category:
Backend API
Target version:
-
Start date:
2019-07-15
Due date:
% Done:

0%

TYPO3 Version:
8
PHP Version:
7.2
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

Description

Editing a translated record, where the l10n_parent is defined as group field in TCA (for performance reasons) leads to an exception in the backend IF the record in this very table with UID 1 does NOT exist.

The reason is the \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseLanguageRows class which relies on $result['databaseRow']['l10n_parent'] being a string/int.

In case of being defined as group field the l10n_parent is an array since the Form Engine refactoring.
As this $result['databaseRow']['l10n_parent'] is cast to an integer, the class subsequently tries to work on UID 1. (there is always exactly 1 element in the array)

TCA

        'l10n_parent' => [
            'displayCond' => 'FIELD:sys_language_uid:>:0',
            'exclude' => false,
            'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
            'config' => [
                'type' => 'group',
                'internal_type' => 'db',
                'allowed' => 'tx_myext_domain_model_location',
                'size' => 1,
                'maxitems' => 1,
                'minitems' => 0,
            ],
        ],

Error message:

Default language record with id 1 not found in table tx_myext_domain_model_location while editing record 1234@


Related issues

Related to TYPO3 Core - Bug #77301: FormEngine must handle l10n_parent fields correctly even if not a select Closed 2016-07-29

History

#1 Updated by Gerrit Code Review about 1 month ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61301

#2 Updated by Gerrit Code Review about 1 month ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61302

#3 Updated by Markus Klein about 1 month ago

  • Related to Bug #77301: FormEngine must handle l10n_parent fields correctly even if not a select added

#4 Updated by Gerrit Code Review about 1 month ago

Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61302

Also available in: Atom PDF