[TYPO3-core] RFC: #12652: Value Preview of empty timestamp shows "01-01-70 (-40 yrs) "

David Bruchmann typo3-team-core at bruchmann-web.de
Tue Nov 24 13:42:24 CET 2009


----- Ursprüngliche Nachricht -----
Von:        Martin Kutschker <masi-no at spam-typo3.org>
Gesendet:   Dienstag, 24. November 2009 12:28:44
An:         typo3-team-core at lists.typo3.org
CC:
Betreff:    Re: [TYPO3-core] RFC: #12652: Value Preview of empty 
timestamp shows "01-01-70 (-40 yrs) "
> Benjamin Mack schrieb:
>> Hey,
>>
>> +1 for Davids idea. Let's make it "the right way".
> 
> In theory yes, but beware TYPO3 often casts strings to integers (ie treats '' as 0 - and converts it
> usually too [!]). So a NULL value from the DB won't survive long in the internals of TYPO3.
> 
> I stumbled over this when I was trying to fix some issues. In the end I gave up because it wasn't so
> easy to teach TYPO3 the difference between '' and 0.
> 
> Masi

Hy Masi,

concerning this thread I'm astonished about several things.
One of them is that you tried to send an unparsed NULL-value to Browser ;-)

It's a mysql-Value and has to be interpreted by PHP.
Concerning my Proposition also the TCA-Configuration of some Forms have 
to be changed perhaps because I suppose the 0 is inserted by JS.
Another Place to change would be the kickstarter.

I think it's also possible to leave the field only empty but NULL 
defines that there wasn't made any entry and an empty field could mean 
something like "unknown to user". What I want to say: With NULL you get 
an additional possibility to handle the value - But I'm not sure about 
that, perhaps the NULL is inserted by MySql when the field is empty.
On the other hand: even if NULL is inserted it's easier or clearer to 
handle the difference between NULL and '0' I think as '0' and ''.

I'm open for other solutions but eliminating a day like Steffen proposed 
is no real bug-fixing - then it's better to leave it like it is because 
I'm sure some agencies have their own solutions which wouldn't work with 
  this change and the official version wouldn't be correct too.

Best Regards
David


More information about the TYPO3-team-core mailing list