[TYPO3-mvc] f:form.select is not saved

Christian Kartnig office at hahnepeter.de
Sat Mar 12 12:05:57 CET 2011


Hi!

Thanks for answering, Franz!
Yes, an 1:1 relationship works well. Still the problem described is 
there. The reference to the country is not saved, unless I set the uid 
like this:

$countryUid = $company->getCountry()->getUid();
$company->setCountry($countryUid);

$this->companyRepository->update($company);

Do you know why?

best regards,
Christian




Am 12.03.2011 11:08, schrieb Franz Koch:
> Hey,
>
>> Now, I already found out, that a single select (multiple=false) attaches
>> the object in 1:1 relationships, but the uid of the object is required
>> in order to get saved correctly.
>>
>> In n:1 relationships (which are according to the extbase book best
>> realized by an n:m relationship having maxitems set to 1) the single
>> select doesn't work out at all, because in the name of the form element,
>> the [] indicating a new array element is missing.
>> When I add this [] in the Viewhelper, the object is saved correctly.
>
> why should you need a n:m relation for this if one company can only be
> related to one country. Just make it a 1:1 relation and you're good,
> because I don't think that your country objects will have back
> references to the companies, will they? Never had any problems with this.
>



More information about the TYPO3-project-typo3v4mvc mailing list