[TYPO3-mvc] Blank Flexform fields overwrite TypoScript values???

Martin Kutschker masi-no at spam-typo3.org
Thu Feb 25 10:40:01 CET 2010


Franz Koch schrieb:
> Hi,
> 
>> But this way you cannot set an empty value via flex form.
> 
> in which cases do you need to know if the flexform value was NULL/empty
> and don't want it to fall back to the default TS configuration if
> available?

In every case where the empty string (or 0 for numbers) is a valid value. You cannot distinct
between not set and set to empty/zero.

Maybe these cases are rare, but I've stumbled upon this problem before.

>> And it doesn't work for numbers because TYPO3 doesn't like NULL values
>> for them. Any empty string will become a 0.
> 
> In which cases? I use this override method since ages and never had any
> problem in any complex flexform. If you have a select box in your
> flexform, simply add a additional select option with value '' and the
> label 'default settings' to it and it'll nicely fall back to the default
> value. If anything else is selected (maybe even the value 0) it'll
> override the TS setting and everything is perfect

Works fine for select (I have said that). But assume you have a default *integer* value in TS that
is eg 5. Assume further that the valid range is -10 to 10. Now the nice feature of TYPO3 integer
fields comes into play that the empty string will become a 0 value. Duh. The user cannot even leave
the field empty. So he'll never get the TS value of 5.

Masi


More information about the TYPO3-project-typo3v4mvc mailing list