[TYPO3-mvc] fluid selector - Argument passed to x must be an instance of y, string given

Christian Essl essl at incert.at
Tue Oct 4 13:03:41 CEST 2011


Hi,

I now added optionValueField:

      <f:form.select id="ausbildungsschwerpunkt" property="ausbildungsschwerpunkt"
        options="{ausbildungsschwerpunkte}" optionLabelField="titel" optionValueField="uid">
      </f:form.select>

But the problem is still the same. Shouldn't uid be the default key?

-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von Claus Due
Gesendet: Dienstag, 04. Oktober 2011 12:47
An: TYPO3 v4 MVC project
Betreff: Re: [TYPO3-mvc] fluid selector - Argument passed to x must be an instance of y, string given

Hi Christian,

Would you be able to use {object.uid} as the value argument of the selector? That should prevent your object vs. string error message.

Kind regards,
Claus

On Oct 4, 2011, at 12:27 PM, Christian Essl wrote:

> Hi,
> 
> I extended my fluid-formular to load in a foreign table and put it in a selector. Now when I try to save a new object with the formular, I get the following error:
> 
> PHP Catchable Fatal Error: Argument 1 passed to Tx_Extensionname_Domain_Model_Lehrgang::setAusbildungsSchwerpunkt() must be an instance of Tx_Extensionname_Domain_Model_Ausbildungsschwerpunkt, string given in ... Lehrgang.php line 448
> 
> This means the option-value from the selector (which is the uid) is treated a string, but extbase expects an object. I compared my code with the blog_example (where a list of administrators is loaded into a selector) but I can't figure out the difference. Everything from the controller, tot he form and model is done the same way...
> 
> The newAction and createAction look like this:
> http://pastebin.com/sRBZqkCt
> 
> The model is very basic:
> http://pastebin.com/npg7K5qJ
> 
> Regards,
> Christian
> _______________________________________________
> 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


More information about the TYPO3-project-typo3v4mvc mailing list