Bug #80068
closedType value (?) from database record not defined in TCA of table
0%
Description
DatabaseRecordTypeValue->addData() throws an exception if $recordTypeValue could not be found.
This happens for records that are not in the default language with no l10n_parent (i.e. l10n_parent = 0), have a TCA field configuration with multiple types but no default type "0" and a TCA field configuration with "l10n_mode = exclude" set.
DatabaseRecordTypeValue->getValueFromDefaultLanguageRecordIfConfigured() returns null since $result['defaultLanguageRow'] is null and there's no null check in place.
Sample TCA:
'tx_extbase_type' => [ 'exclude' => 1, 'l10n_mode' => 'exclude', 'label' => 'Extbase type', 'config' => [ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ ['Type A, 'Tx_Extension_Domain_Model_A'], ['Type B', 'Tx_Extension_Domain_Model_B'] ], 'size' => 1, 'maxitems' => 1, 'default' => 'Tx_Extension_Domain_Model_A' ] ]
Updated by Christian Kuhn over 7 years ago
- Status changed from New to Needs Feedback
mmmh, a record not in default language with l10n_parent = 0 and then having l10n_mode=exclude does not make sense.
Updated by Christoph Dörfel over 7 years ago
Christian Kuhn wrote:
mmmh, a record not in default language with l10n_parent = 0 and then having l10n_mode=exclude does not make sense.
Haha, yes.
Although records in the database and the TCA configuration should somehow match, a user might be able to change the sys_language_uid of a record (from default to something > 0). After that the user can never undo his mistake because of the "Uncaught TYPO3 Exception" and is stuck with a broken record.
From the TCA Reference Documentation:
l10n_mode = exclude – Field will not be shown in TCEforms if this record is a localization of the default language.
So the field should be shown since the record is not a localization of the default language. It's no a record in the default language either, but that's another story.
Updated by Oliver Hader over 7 years ago
- Category changed from DataHandler aka TCEmain to FormEngine aka TCEforms
Updated by Alexander Opitz about 7 years ago
- Status changed from Needs Feedback to New
Updated by Benni Mack over 4 years ago
- Status changed from New to Closed
Hey all,
I guess this is fixed in TYPO3 v8 now with our streamlined language synchronization parameter. If you feel this is still an issue, let me know, and I will re-open the issue.