Issue Bug Closed

#80068Type value (?) from database record not defined in TCA of table

Christoph Dörfel 03/01/17, 09:37 updated 03/08/20, 12:00

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'
    ]
]

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.