Type value (?) from database record not defined in TCA of table
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.
'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' ] ]
#2 Updated by Christoph Dörfel over 2 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.
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.