[TYPO3-mvc] removing assigned model

J. Weber newsletter at jewe.net
Mon Jun 20 15:44:13 CEST 2011


Hi all,

i have two models: task and place, where a task can have non or 1 place.
How can i reset a place within a form?

I build my place-select field with a blank-option:
     array_merge(array("0" => " - no place - "), $places->toArray());

If a place is assigned and i try to remove the place, extbase tries to 
find a place-object with uid 0. This fails and the place is not updated. 
Also the setPlace()-method is not called, so i cant handle this case.
If i use instead:
     array_merge(array("" => " - no place - "), $places->toArray());

i get an error: transformToObject() accepts only numeric values and arrays


Whats the best practice for this relationship?

Regards, Jens



More information about the TYPO3-project-typo3v4mvc mailing list