[TYPO3-english] TCA: default-value is always used if the array is empty

Andy Pattynama andy.pattynama at gmail.com
Tue Sep 21 11:39:50 CEST 2010


Hi there,

I have following problem in my ext_tables.php:

'tx_myext_author' => array (
'exclude' => 1,
'label' => 'LLL:EXT:myext/locallang_db.xml:tt_news.tx_myext_author',
'config' => array (
'type' => 'select',
'foreign_table' => 'tx_myext_authors',
'foreign_table_where' => 'ORDER BY tx_myext_authors.uid',
'size' => 10,
'minitems' => 0,
'maxitems' => 10,
'default' => $GLOBALS["BE_USER"]->user["uid"],

            'wizards' => array(
              'suggest' => array(
                'type' => 'suggest',
                'default' => array(
                    'searchWholePhrase' => 1
                ),
              ),
            ),
)
),

The default value for the the field tx_myext_author should be the current
user id. As you can see, the minitems-property is set to 0, so an empty
entry should be accepted. Now, everytime when I open an existing record,
with no item is selected, it automatically selects the default-value. But
that should only happen, when I create a new record. Is there a way to solve
that problem so that the default-value is only used, when a new record is
created?

Thanks in advance,
Andy


More information about the TYPO3-english mailing list