-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Labels
DiscussionGather different opinions on a topicGather different opinions on a topic
Description
I recently stumbled into a 'Type value 0 from database record not defined in TCA' exception after importing records into a ContentBlocks/RecordTypes table using multiple types.
While fixing the issue I noticed that CB currently uses 1 as TCA default type, but TYPO3 nowadays uses 0:
At least one type has to be configured before any field will show up, the default type is
0.
EXT:backend/Classes/Form/FormDataProvider/DatabaseRecordTypeValue.php
if (empty($result['processedTca']['types'][$recordTypeValue])
&& empty($result['processedTca']['types']['0'])
&& empty($result['processedTca']['types']['1'])
) {
...
// Check the determined value actually exists as types key, otherwise fall back to 0 or 1, 1 for "historical reasons"
if (empty($result['processedTca']['types'][$recordTypeValue])) {
$recordTypeValue = !empty($result['processedTca']['types']['0']) ? '0' : '1';
}Affected Code
TYPO3\CMS\ContentBlocks\Definition\TableDefinition->getDefaultTypeDefinition()only checks for type1TYPO3\CMS\ContentBlocks\Loader\ContentBlockLoader->createTypeName()always returns1for records withouttypeNamedefinition- Comment in
TYPO3\CMS\ContentBlocks\Generator\TcaGenerator->fillTypeFieldSelectItems()(the default type "1") TYPO3\CMS\ContentBlocks\Definition\Factory\Processing\ProcessingInput->resolveTypeName()ignorestypeNamedefinition if notypeFieldis defined and always returns1
Nice to have
- CB should ensure type
0exists (copy the default type definition) so you don't have to usetypeName: 0for the record definition with highest priority.
Metadata
Metadata
Assignees
Labels
DiscussionGather different opinions on a topicGather different opinions on a topic