Project

General

Profile

Actions

Bug #93817

closed

TCA unique evaluation fails for unchanged value in default language with l10n_mode=exclude

Added by Christoph Lehmann about 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2021-03-25
Due date:
% Done:

100%

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

Description

This is my field

        'nr' => [
            'exclude' => true,
            'l10n_mode' => 'exclude',
            'label' => $ll . 'fields.nr',
            'config' => [
                'type' => 'input',
                'size' => 5,
                'max' => 5,
                'range' => array(
                    'upper' => 99999
                ),
                'placeholder' => 'xxxxx',
                'eval' => 'num, nospace, trim, unique'
            ]
        ],

This is my ctrl:

    'ctrl' => [
...
        'languageField' => 'sys_language_uid',
        'transOrigDiffSourceField' => 'l10n_diffsource',
        'transOrigPointerField' => 'l10n_parent',
    ],

This is fine so far.

How to reproduce:

  • Create a record
  • fill nr with 12345
  • Translate the record

The translation get the same value

  • Edit the record in default language again

=> Issue: The value for nr changes, because the sql statement for the unique check does not respect 'languageField' in ctrl section.

After saving i see a warning:

4: The value of the field "nr" has been changed from "12345" to "123450" as it is required to be unique.

The bug was introduced in #87038

See https://forge.typo3.org/projects/typo3cms-core/repository/1749/revisions/08ae979e21c2004fe055c2ceaed97aea5e3fdb5e/diff/typo3/sysext/core/Classes/DataHandling/DataHandler.php

The line

&& $GLOBALS['TCA'][$table]['columns'][$field]['languageField'] ?? '' !== '') {

needs to be

&& $GLOBALS['TCA'][$table]['ctrl']['languageField'] ?? '' !== '') {

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #87038: Unique evaluation does not work with l10n_mode=exclude after editing original record againClosedBenni Mack2018-11-29

Actions
Actions #1

Updated by Christoph Lehmann about 3 years ago

  • Related to Bug #87038: Unique evaluation does not work with l10n_mode=exclude after editing original record again added
Actions #2

Updated by Christoph Lehmann about 3 years ago

  • Description updated (diff)
Actions #3

Updated by Christoph Lehmann about 3 years ago

  • Description updated (diff)
Actions #4

Updated by Gerrit Code Review about 3 years 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/+/68613

Actions #5

Updated by Gerrit Code Review about 3 years ago

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

Actions #6

Updated by Christoph Lehmann about 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Benni Mack almost 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF