[TYPO3-dev] DBAL problems with pages.fe_group

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Tue Jun 27 16:43:52 CEST 2006


Martin Kutschker schrieb:
> Martin Kutschker schrieb:
> 
>>
>> So what is best option?
>>
>> a) Simply to remove the NOT NULL and the then useless DEFAULT '0'?
>> b) Adding TCA options that enforce the SQL default in situations like 
>> this?
>> c) Add DB triggers that turn '' into '0' for such fields?
>>
>> I'm for a) If the field is a list then '' is an empty list not '0'. 
>> But is the Core ready for this?
> 
> 
> No, it isn't. See bug #2866.
> 
> Without changing the Core it must be c) then.

create or replace trigger "pages_fe_group"
before insert on "pages"
for each row
when (NEW."fe_group" is null or NEW."fe_group" = '')
begin
:NEW."fe_group" := '0';
end;

I guess that such a trigger is only needed for varchars where TYPO3 will 
insert/update '' but really means '0'.

IMHO this should be changed in 4.1/4.5. I think that the "default" of '0' 
should go after all a list may be empty.

But for now this works with Oracle.

Masi

PS: Oracle XE is really a nice and free playground.




More information about the TYPO3-dev mailing list