Project

General

Profile

Actions

Bug #105441

open

Autogeneration of selectSingle with foreign_table and a custom item with value null tries to create a varchar field

Added by S P about 1 month ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2024-10-24
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
13
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The following auto-generates a varchar(255). I expected it to create an int unsigned DEFAULT NULL. Changing the custom item to 'value' => 0 auto-generates int unsigend NOT NULL DEFAULT 0.

If nullable fields are not desired here by the core, I'd expect that null would be treated for foreign_table-enabled selects implicitly as (int)0, not as varchar. Having a field holding an integer uid extended by an optional null being auto-cast to varchar seems wrong.

'config' => [
    'type' => 'select',
    'renderType' => 'selectSingle',
    'foreign_table' => 'some_foreign_table',
    'default' => null,
    'items' => [
        [
            'label' => 'Please choose!',
            'value' => null
        ]
    ]
]

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #105490: TCA-driven SQL auto-generation should not fallback to varchar for "item-less" selectSingle fields (purely itemsProcFunc/FormDataprovider-filled)Rejected2024-10-28

Actions
Actions #1

Updated by S P about 1 month ago

  • Related to Bug #105490: TCA-driven SQL auto-generation should not fallback to varchar for "item-less" selectSingle fields (purely itemsProcFunc/FormDataprovider-filled) added
Actions

Also available in: Atom PDF