[TYPO3-english] TCA: insert NULL value with TCA type 'select'

Viktor Livakivskyi invisible.kinder at gmail.com
Tue Jun 14 18:19:31 CEST 2016


Hi, List.

I want a possibility to insert NULLs via BE into a field of type "select".

My TCA definition is follwoing:
'industry'    => [
    'exclude' => 0,
    'label'   => 'LLL:EXT:my_ext/Resources/Private/Language/locallang_db.xlf:fe_users.industry',
    'config'  => [
        'type'          => 'select',
        'renderType'    => 'selectSingle',
        'foreign_table' => 'tx_myext_domain_model_industry',
        'minitems'      => 0,
        'items'         => [
            ['', null],
        ]
    ]
],

ext_tables.sql:
industry int(11) unsigned default NULL,

The problem is, that whenever an empty value from "industry" is sent to a server it is translated into following query:
UPDATE fe_users SET industry='',tstamp='1465920150' WHERE uid=2;
And due to disabled "strict mode" it translates to 0 by MySQL.

Also tried to set '-1' as drop-down option value, but result is the same.

Is it a missing feature (bug) or I'm doing something wrong here?

TYPO3 7.6.9


More information about the TYPO3-english mailing list