[TYPO3-core] RFC #8542: Cannot create page with Mysl in strict mode (STRICT_TRANS_TABLES)

Martin Kutschker martin.kutschker-n0spam at no5pam-blackbox.net
Fri May 30 14:44:05 CEST 2008


Martin Kutschker schrieb:
> Martin Kutschker schrieb:
>> Hi!
>>
>> This is a patch request for 4.2 and trunk.
>>
>> Problem: When I want to create a page I get an Mysql error saying that 
>> it has an invalid value for an integer field. The problem is that 
>> "storage_pid" is when not set initially an empty string. It seems that 
>> I get only default values in strict mode for NULL, but no type 
>> conversion from empty string to 0 occurs.
>>
>> Solution: Make the conversion in TCEmain if necessary. A possible 
>> different solution would be to use 0 as TCA default for group fields 
>> (internal_type "db"), but I think it is more proper to make the 
>> conversion in TCEmain if necessary for all such occurrences.
> 
> After further analysis

There's more of that stuff. Take tt_content/sys_language_uid. For this 
field 0 is a perfectly valid value and it's an INT. Yet TCEmain tries to 
be very clever and removes in a function that checks for maxItems all 
elements that are 0. Why? I have no idea. It may act as a kind of 
safeguard against invalid pids, but is apllied at the wrong place.

I think about removing this check in this or avoiding to call it for 
single item select boxes. I think for a single select a $value = 
$valueArray[0] is ok, no need to fiddle with checks for 0. If I want a 0 
value in my select box, TCEmain should let me have it.

Masi


More information about the TYPO3-team-core mailing list