[TYPO3-core] RFC: Bugfix #9659: TCEmain wrongly tests required input-type fields

Martin Kutschker masi-no at spam-typo3.org
Fri Oct 31 09:15:31 CET 2008


Francois Suter schrieb:
> This is an SVN patch request.
> 
> Type: Bugfix
> 
> Bugtracker references:
> http://bugs.typo3.org/view.php?id=9659
> 
> Branches:
> TYPO3_4-1, TYPO3_4-2 and trunk
> 
> Problem:
> When an input-type field is marked as "required" in the TCA, TCEmain
> tests it simply with
> 
> if (!$value)
> 
> This is insufficient, since in the case of an "int" field, for example,
> 0 is a perfectly valid value, but it will fail the "required" test.
> 
> 
> Solution:
> Introduce a finer testing:
> 
> if (!isset($value) || $value === '')

+1

Masi


More information about the TYPO3-team-core mailing list