Bug #76943
closed
In new BE extbase extension records sys_language_uid is set to -1 by default but should be 0
Added by Michael Hitzler over 8 years ago.
Updated over 4 years ago.
Description
If I create a new extbase record in a 7.6.9 backend the default sys_language_uid is set to -1 which is all languages. I think it should be 0 (default) as a default. This can be archived by additionally set under config 'default' => 0. But default should be our default value here I'd say. In 6.2 versions the expected behavior "0" for sys_language_uid works out of the box without additional need to config 'default' => 0.
Some additional info
having some tca like that
'sys_language_uid' => array(
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.language',
'config' => array(
'type' => 'select',
'foreign_table' => 'sys_language',
'foreign_table_where' => 'ORDER BY sys_language.title',
'items' => array(
array('LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages', -1),
array('LLL:EXT:lang/locallang_general.xlf:LGL.default_value', 0)
),
),
),
- in 6.2 the default value was still "0".
- in 7, the default value - if no "default" is set, it will be the first value which is now -1
still don't understand ... sorry, my head is in doctrine at the moment.
you're saying that if i have the tca as above, then 6.2 chooses 0 as displayed value if opening the record (new record) in formEngine. on save, 0 is persisted. and this very TCA with 7.6 formEngine chooses the first element with value -1 and thus -1 is now stored?
did i understand that correctly?
if so, i'd ask how that happened since afaik we didn't change default selection if no default is set in formEngine. additionally, i don't understand what extbase has to do with all that.
- Target version changed from next-patchlevel to Candidate for patchlevel
- Status changed from New to Closed
this has been resolved in the meantime, just for documentation, current TCA should look like this
'sys_language_uid' => [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'special' => 'languages',
'items' => [
[
'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages',
-1,
'flags-multiple'
],
],
'default' => 0,
]
],
Also available in: Atom
PDF