Project

General

Profile

Bug #93817

Updated by Christoph Lehmann over 3 years ago

This is are my field fields 

 <pre> 
         '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' 
             ] 
         ], 
         'title' => [ 
             'exclude' => true, 
             'l10n_mode' => 'prefixLangTitle', 
             'label' => $ll . 'fields.title', 
             'config' => [ 
                 'type' => 'input', 
                 'size' => 40, 
                 'eval' => 'required, trim, unique' 
             ] 
         ], 
 </pre> 

 This is my ctrl: 

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

 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. 

 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 

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

 needs to be 

 <pre> 
 && $GLOBALS['TCA'][$table]['ctrl']['languageField'] ?? '' !== '') { 
 </pre> 

Back