[TYPO3-mvc] Extbase and setting a date property to null via forms

Falk Kühnel fk at cogitatio.de
Thu Oct 18 20:06:14 CEST 2012


Hi Henjo!

I found the problem.
Basically its the PropertyMapper.
I have switched to the rewritten PropertyMapper and found the same problem.

In the DateTimeConverter there is no converting of an empty string to a null object, which it should have in my oppinion.
And additionally, the PropertyMapper only sets properties, that are not NULL, which then does not allow for any properties to be set to null via the PropertyMapper conversion.

Ill put that up as a bug report and see what happens.



Am 18.10.2012 um 12:22 schrieb Henjo Hoeksma <me at henjohoeksma.nl>:

> Hi Falk,
> 
> I have read something here in this list about this before. You might want to try and search for that.
> 
> Anyways: it might help if you share some code of your model (property, getter & setter).
> 
> You are talking in your first post about a DateTime object - so... ;-)
> 
> Henjo
> 
> On Oct 17, 2012, at 3:51 PM, Falk Kühnel <fk at cogitatio.de> wrote:
> 
>> Hi Henjo!
>> 
>>> can't you allow it to be NULL in your domain model?
>> 
>> Well, I dont know how. I can set null programatically, but not through a form.
>> 
>>> NULL is not a DateTime object so it won't validate...
>> 
>> I have set no validation annotation, and the setter has no typehint set either. So i am a bit lost, where the formprocessing is handled and where the empty string for a dateTime object is interpreted, so that the property is not set, when an empty string is sent.
>> 
>> 
>> 
>> Liebe Grüße
>> Falk Kühnel
>> 
>> -- 
>> cogitatio - Ihr kompetenter Medienpartner
>> 
>> Am Lappenweiher 3
>> 53127 Bonn
>> 
>> fk at cogitatio.de
>> Tel: 0228 - 3693699
>> www.cogitatio.de
>> 
>> 
>> 
>> _______________________________________________
>> TYPO3-project-typo3v4mvc mailing list
>> TYPO3-project-typo3v4mvc at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
> 
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc

Liebe Grüße
Falk Kühnel

-- 
cogitatio - Ihr kompetenter Medienpartner

Am Lappenweiher 3
53127 Bonn

fk at cogitatio.de
Tel: 0228 - 3693699
www.cogitatio.de





More information about the TYPO3-project-typo3v4mvc mailing list