Bug #93817
closedTCA unique evaluation fails for unchanged value in default language with l10n_mode=exclude
100%
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
The line
&& $GLOBALS['TCA'][$table]['columns'][$field]['languageField'] ?? '' !== '') {
needs to be
&& $GLOBALS['TCA'][$table]['ctrl']['languageField'] ?? '' !== '') {
Updated by Christoph Lehmann over 3 years ago
- Related to Bug #87038: Unique evaluation does not work with l10n_mode=exclude after editing original record again added
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Christoph Lehmann over 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 862effd32cc8b552f44051c9ce320e36d253821a.