[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 12:27:14 CEST 2011


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


More information about the TYPO3-project-typo3v4mvc mailing list